pip安装错误,用镜像

Posted cuzz

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了pip安装错误,用镜像相关的知识,希望对你有一定的参考价值。

  Retrying (Retry(total=4, connect=None, read=None, redirect=None)) after connection broken by ‘ConnectTimeoutError(<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7ffb0d9c35d0>, ‘Connection to pypi.python.org timed out. (connect timeout=15)‘)‘: /simple/pymongo/
  Retrying (Retry(total=3, connect=None, read=None, redirect=None)) after connection broken by ‘ConnectTimeoutError(<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7ffb0d9c3790>, ‘Connection to pypi.python.org timed out. (connect timeout=15)‘)‘: /simple/pymongo/
  Retrying (Retry(total=2, connect=None, read=None, redirect=None)) after connection broken by ‘ConnectTimeoutError(<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7ffb0d9c32d0>, ‘Connection to pypi.python.org timed out. (connect timeout=15)‘)‘: /simple/pymongo/
  Retrying (Retry(total=1, connect=None, read=None, redirect=None)) after connection broken by ‘ConnectTimeoutError(<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7ffb0d9c3f10>, ‘Connection to pypi.python.org timed out. (connect timeout=15)‘)‘: /simple/pymongo/

  pip源配置文件可以放置的位置:

 
Linux/Unix:
/etc/pip.conf
~/.pip/pip.conf
~/.config/pip/pip.conf
 
Mac OSX:
~/Library/Application Support/pip/pip.conf
~/.pip/pip.conf
/Library/Application Support/pip/pip.conf
 
Windows:
%APPDATA%\pip\pip.ini
%HOME%\pip\pip.ini
C:\Documents and Settings\All Users\Application Data\PyPA\pip\pip.conf (Windows XP)
C:\ProgramData\PyPA\pip\pip.conf (Windows 7及以后)
 
pip配置的主要一些配置:
 
可以配置如下:
 
[global]

index-url = http://pypi.douban.com/simple #豆瓣源,可以换成其他的源

trusted-host = pypi.douban.com            #添加豆瓣源为可信主机,要不然可能报错

disable-pip-version-check = true         
#取消pip版本检查,排除每次都报最新的pip

timeout = 120

 

以上是关于pip安装错误,用镜像的主要内容,如果未能解决你的问题,请参考以下文章

用国内镜像源pip加速安装模块

更改pip安装源的镜像解决安装总是timeout的情况

Jupyter中安装第三方库和切换pip镜像源

Jupyter中安装第三方库和切换pip镜像源

Mac上python 在终端使用pip3安装包报ConnectTimeoutError错误

记一次 pip list --outdated 错误