Python安装第三方库报错check_hostname requires server_hostname

使用pip进行requests模块安装时,报错check_hostname requires server_hostname

 

 

更改pip镜像源后,问题解决。

pip镜像源设置:  文件管理器输入 %APPDATA% 跳转至appdata目录,在该目录下创建pip目录,然后创建pip.ini文件,

 

内容如下

[global]
index-url = http://mirrors.aliyun.com/pypi/simple
[install]
trusted-host = mirrors.aliyun.com

 

该镜像为阿里镜像,也可替换成其他的国内镜像。

也有部分人是由于代理的问题导致的该错误,win10按windows键搜索代理后关闭代理即可。

 

posted @ 2021-08-23 10:33  flashh  阅读(866)  评论(0)    收藏  举报