安装Python模块时,报错Retrying(Retrying(total=4,connect=None,read=None,redirect=None))

        最近在复现论文代码时,安装python requirements时,报错Retrying(Retry(total=4,connect=None,read=None,redirect=None,status=None)),错误信息类似如下:

安装Python模块时,报错Retrying(Retrying(total=4,connect=None,read=None,redirect=None))_第1张图片

        原因是数据源有问题,更换python的pip源。国内pip源有:

        阿里云 http://mirrors.aliyun.com/pypi/simple/

        中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple/

        豆瓣(douban) http://pypi.douban.com/simple/

        清华大学 https://pypi.tuna.tsinghua.edu.cn/simple/

        中国科学技术大学 http://pypi.mirrors.ustc.edu.cn/simple/

MAC下设置:

        Mac电脑先找一下.pip文件,如果没有则需要手动创建。

cd ~/
ls -a

        发现没有这个.pip文件夹,手动创建:

mkdir .pip
cd .pip/
vi pip.conf

        如果使用清华大学源,加入以下内容,

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

        或者使用阿里云的源,加入以下内容:

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

        或者使用豆瓣的源,加入以下内容:

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

Linux设置

        需要创建或修改的配置文件(一般都是创建),Linux的文件在~/.pip/pip.conf,创建过程如上。

安装Python模块时,报错Retrying(Retrying(total=4,connect=None,read=None,redirect=None))_第2张图片

Windows设置

         Windows在%HOMEPATH%\pip\pip.ini下

 

你可能感兴趣的:(服务器)