pip安装时遇到的问题解决WARNING: Retrying (Retry(total=4,connect=None, read=Noneredirect=None,status=None))

WARNING: Retrying (Retry(total=4,connect=None, read=Noneredirect=None,status=None))

遇到这个问题一般是连续弹出一行
pip安装时遇到的问题解决WARNING: Retrying (Retry(total=4,connect=None, read=Noneredirect=None,status=None))_第1张图片

1.问题原因

网络连接超时,检查网络是否连接,如果网络连接是好的就是用了官方源,得换成国内镜像源

2.解决方法

切换为国内镜像源:

1.pip镜像源

直接命令行输入:

pip install -i https://pypi.tuna.tsinghua.edu.cn/simple +库名

然后回车 等待显示有successfully字样即为安装成功

2.Linux系统Pip切换镜像源

以Python3为例
1.升级pip3

pip3 install --upgrade pip

2.打开并修改pip文件

mkdir ~/.pip
gedit ~/.pip/pip.conf

添加

[global]
index-url = 镜像源
[install]
trusted-host = 镜像源

例如:

[global]
index-url =  https://pypi.mirrors.ustc.edu.cn/simple
[install]
trusted-host =  https://pypi.mirrors.ustc.edu.cn

你可能感兴趣的:(python学习笔记,pip,python,linux)