bogon:~ ansheng$ pip install --upgrade pip
You are using pip version 7.1.0, however version 9.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
Collecting pip
Downloading pip-9.0.1-py2.py3-none-any.whl (1.3MB)
0% | | 4.1kB 17.7MB/s eta 0:00:01Exception:
Traceback (most recent call last):
File "/Library/Python/2.7/site-packages/pip-7.1.0-py2.7.egg/pip/basecommand.py", line 223, in main
status = self.run(options, args)
File "/Library/Python/2.7/site-packages/pip-7.1.0-py2.7.egg/pip/commands/install.py", line 282, in run
requirement_set.prepare_files(finder)
File "/Library/Python/2.7/site-packages/pip-7.1.0-py2.7.egg/pip/req/req_set.py", line 334, in prepare_files
functools.partial(self._prepare_file, finder))
File "/Library/Python/2.7/site-packages/pip-7.1.0-py2.7.egg/pip/req/req_set.py", line 321, in _walk_req_to_install
more_reqs = handler(req_to_install)
File "/Library/Python/2.7/site-packages/pip-7.1.0-py2.7.egg/pip/req/req_set.py", line 491, in _prepare_file
session=self.session)
File "/Library/Python/2.7/site-packages/pip-7.1.0-py2.7.egg/pip/download.py", line 825, in unpack_url
session,
File "/Library/Python/2.7/site-packages/pip-7.1.0-py2.7.egg/pip/download.py", line 673, in unpack_http_url
from_path, content_type = _download_http_url(link, session, temp_dir)
File "/Library/Python/2.7/site-packages/pip-7.1.0-py2.7.egg/pip/download.py", line 886, in _download_http_url
_download_url(resp, link, content_file)
File "/Library/Python/2.7/site-packages/pip-7.1.0-py2.7.egg/pip/download.py", line 621, in _download_url
for chunk in progress_indicator(resp_read(4096), 4096):
File "/Library/Python/2.7/site-packages/pip-7.1.0-py2.7.egg/pip/utils/ui.py", line 133, in iter
for x in it:
File "/Library/Python/2.7/site-packages/pip-7.1.0-py2.7.egg/pip/download.py", line 586, in resp_read
decode_content=False):
File "/Library/Python/2.7/site-packages/pip-7.1.0-py2.7.egg/pip/_vendor/requests/packages/urllib3/response.py", line 307, in stream
data = self.read(amt=amt, decode_content=decode_content)
File "/Library/Python/2.7/site-packages/pip-7.1.0-py2.7.egg/pip/_vendor/requests/packages/urllib3/response.py", line 267, in read
raise ReadTimeoutError(self._pool, None, 'Read timed out.')
ReadTimeoutError: HTTPSConnectionPool(host='pypi.python.org', port=443): Read timed out.
坑大了,每次都装不上。
1
GhostFlying 2016-12-13 13:02:15 +08:00
proxychains
|
2
dusong7 2016-12-13 13:07:38 +08:00
pip3 install --index-url https://pypi.douban.com/simple scipy
|
3
xucuncicero 2016-12-13 13:09:57 +08:00 via iPhone
换源
|
4
ansheng OP @dusong7 thx,用好了,
```bash sudo pip install --index-url https://pypi.douban.com/simple ipython sudo pip install --index-url https://pypi.douban.com/simple --upgrade pip ``` |
5
billion 2016-12-13 13:12:47 +08:00
proxychains4
|
6
knightdf 2016-12-13 13:15:24 +08:00
export ALL_PROXY=socks5://127.0.0.1:1080
|
7
ansheng OP |
9
yylzcom 2016-12-13 13:23:50 +08:00
proxychains 完美解决
proxychains 只对当前命令起作用…… |
10
Dcatch 2016-12-13 13:34:05 +08:00
可以考虑国内的源 豆瓣的就不错 目前一直在用
|
11
Dcatch 2016-12-13 13:34:30 +08:00
pip 源更改设置
pipy 国内镜像目前有: http://pypi.douban.com/ 豆瓣 http://pypi.hustunique.com/ 华中理工大学 http://pypi.sdutlinux.org/ 山东理工大学 http://pypi.mirrors.ustc.edu.cn/ 中国科学技术大学 手动指定源: 在 pip 后面跟-i 来指定源,比如用豆瓣的源来安装 web.py 框架: pip install web.py -i http://pypi.douban.com/simple 注意后面要有 /simple 目录!!! 配置文件 需要创建或修改配置文件( linux 的文件在~/.pip/pip.conf , windows 在%HOMEPATH%\pip\pip.ini ),修改内容为: [global] index-url = http://mirrors.aliyun.com/pypi/simple/ [install] trusted-host=mirrors.aliyun.com 如果不加后面的 install 则需要每次在命令后面加上 --trusted-host |
12
vvoody 2016-12-13 13:42:07 +08:00
$ cat ~/.pip/pip.conf
[global] proxy = 127.0.0.1:50443 |
13
canfoderiskii 2016-12-13 14:15:08 +08:00 via Android 1
我只是增加一个--timeout 60 ,迟早操作会完成。 pypi 毕竟没被墙
|