[Python]Python pip用国内镜像下载的办法

来源:互联网 发布:c语言开发实战宝典pdf 编辑:程序博客网 时间:2024/05/01 04:51

异常信息:

Retrying (Retry(total=2, connect=None, read=None, redirect=None)) after connection broken by ‘ReadTimeoutError(“HTTPSConnectionPool(host=’pypi.python.org’, port=443): Read timed out. (read timeout=15)”,)’: /simple/scipy/

通过pip安装scipy、scikit-learn等库的时候,可能会报上面的错误,国内通过翻墙手段,是可能解决该问题的。下面给个不用翻墙的办法。 

使用国内镜像下载python库的办法。

以下载pandas为例,终端输入命令(前提是python正确安装):

pip  install --index https://pypi.mirrors.ustc.edu.cn/simple/ pandas

注:--index后面也可以换成别的镜像,比如http://mirrors.sohu.com/python/

5 0
原创粉丝点击