在pycharm安装第三方库时报错Try to run this command from the system terminal. Make sure that you use the correct version of 'pip' installed for your Python interpreter located at 'C:\Users\Administrator\AppData\Local\Programs\Python\Python38\python.exe'.
同样在命令行中输入
pip install numpy
得到的是同样的错误,拉到最后看是ValueError: check_hostname requires server_hostname。
这时想到的是换国内的镜像资源,在网上可以找到很多。如下:
清华:
https://pypi.tuna.tsinghua.edu.cn/simple
阿里:
http://mirrors.aliyun.com/pypi/simple
豆瓣:
http://pypi.douban.com/simple
华中理工大学:
http://pypi.hustunique.com
山东理工大学:
http://pypi.sdutlinux.org
中国科学技术大学:
http://pypi.mirrors.ustc.edu.cn
然后试了豆瓣的,在命令行中输入
pip install numpy -i http://pypi.douban.com/simple
还是出现错误,
最后的最后,发现加上--trusted-host pypi.douban.com,这时安装成功了。
pip install numpy -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
第一次搞python,真的是一把辛酸泪,搞了一个下午,以此记录一下。其他的镜像没试,有兴趣的可以试一下。