轉自:https://blog.csdn.net/qq_40024178/article/details/108602688
pip install paramiko --index-url http://pypi.douban.com/simple/ --trusted-host pypi.douban.com
Could not fetch URL https://pypi.tuna.tsinghua.edu.cn/simple/numpy/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.tuna.tsingh
ua.edu.cn', port=443): Max retries exceeded with url: /simple/numpy/ (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate
verify failed: self signed certificate in certificate chain (_ssl.c:1056)'))) - skipping
問題解決: 增加--trusted-host pypi.douban.com
正確命令:
- pip install xxx --index-url http://pypi.douban.com/simple/ --trusted-host pypi.douban.com
註解:
- 1. pip install 表示通過pip 來安裝某種包
- 2. xxx 表示你要安裝的包名,比如pipenv,jupyter等等
- 3. -i http://pypi.douban.com/simple 表示將鏡像地址切換爲國內,這裏切換到了豆瓣
- 4.--trusted-host pypi.douban.com 表示將指定網站設置爲信任服務器
國內鏡像地址:
常用的鏡像地址有:
- 1)http://mirrors.aliyun.com/pypi/simple/ 阿里雲
- 2)https://pypi.mirrors.ustc.edu.cn/simple/ 中國科技大學
- 3) http://pypi.douban.com/simple/ 豆瓣
- 4) https://pypi.tuna.tsinghua.edu.cn/simple/ 清華大學
- 5) http://pypi.mirrors.ustc.edu.cn/simple/ 中國科學技術大學