开发环境:本人用的是windows10专业版,Python3.8。
解决办法: 在用户(user)目录下新建文件夹pip,并在pip文件夹下创建pip.ini配置文件,(pip文件夹下不能直接创建文件,建议在桌面创建好之后复制到pip文件夹下)。
pip.ini配置文件内容如下:
[global]
index-url = https://pypi.tuna.tsinghua.edu.cn/simple
[install]
trusted-host=mirrors.aliyun.com
##下面是一些可替换的镜像
##清华: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/