pip安装第三方库报错

兮城

关注

阅读 50

2022-03-12

1、pip安装第三方库报错:check_hostname requires server_hostname

解决方法:关掉电脑浏览器代理

2、pip安装第三方库报错'Connection to pypi.org timed out. (connect timeout=15)')': /simple/pytest/

解决方法:

1)需要换成国内镜像安装,

pip install requests -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com

2)永久修改

pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple

常用的镜像源

阿里云:https://mirrors.aliyun.com/pypi/simple/
中国科技大学:https://pypi.mirrors.ustc.edu.cn/simple/
清华大学:https://pypi.tuna.tsinghua.edu.cn/simple/
豆瓣:http://pypi.douban.com/simple/

精彩评论(0)

0 0 举报