foreword
When we use the pip that comes with python to install some packages, the following error may be reported:
There are three possibilities for this situation:
The first possibility:
The version of pip is too low, you need to upgrade it, you can execute the following command to try
python -m pip install --upgrade pip
Second possibility:
Considering that it may be due to the speed of the network, you can use domestic mirror sources to speed up
pip install 包 -i https://pypi.tuna.tsinghua.edu.cn/simple/ --trusted-host pypi.douban.com
ps :--trusted-host pypi.douban.com 这是为了获得ssl证书的认证
常见pip镜像源(国内源)
清华:https://pypi.tuna.tsinghua.edu.cn/simple
阿里云:http://mirrors.aliyun.com/pypi/simple/
中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple/
华中理工大学:http://pypi.hustunique.com/
山东理工大学:http://pypi.sdutlinux.org/
豆瓣:http://pypi.douban.com/simple/
The third possibility:
Check whether the proxy or VPN is enabled, turn it off and use the domestic mirror to try to see if it can be solved. My side is that the proxy is turned on and the network is too slow and an error is reported.