安装virtualenvwrapper等提示错误

在尝试使用pip3.6安装virtualenvwrapper时遇到读取超时错误。通过在命令前添加sudo以获取权限,成功解决了安装问题。

安装virtualenvwrapper等提示错误记录

安装代码:
pip3.6 install --target=/Users/liuxiling/virtualenv/virtualenvwrapper virtualenvwrapper

Collecting virtualenvwrapper
Downloading https://files.pythonhosted.org/packages/c1/6b/2f05d73b2d2f2410b48b90d3783a0034c26afa534a4a95ad5f1178d61191/virtualenvwrapper-4.8.4.tar.gz (334kB)
|████████████████████████████████| 337kB 8.2kB/s
Collecting virtualenv
Using cached https://files.pythonhosted.org/packages/05/f1/2e07e8ca50e047b9cc9ad56cf4291f4e041fa73207d000a095fe478abf84/virtualenv-16.7.9-py2.py3-none-any.whl
Collecting virtualenv-clone
Using cached https://files.pythonhosted.org/packages/ba/f8/50c2b7dbc99e05fce5e5b9d9a31f37c988c99acd4e8dedd720b7b8d4011d/virtualenv_clone-0.5.3-py2.py3-none-any.whl
Collecting stevedore
Downloading https://files.pythonhosted.org/packages/b1/e1/f5ddbd83f60b03f522f173c03e406c1bff8343f0232a292ac96aa633b47a/stevedore-1.31.0-py2.py3-none-any.whl (43kB)
|████████████████████████████████| 51kB 18kB/s
Collecting pbr!=2.1.0,>=2.0.0
Downloading https://files.pythonhosted.org/packages/7a/db/a968fd7beb9fe06901c1841cb25c9ccb666ca1b9a19b114d1bbedf1126fc/pbr-5.4.4-py2.py3-none-any.whl (110kB)
|█████████ | 30kB 2.5kB/s eta 0:00:32
错误提示:
ERROR: Exception:
Traceback (most recent call last):
File “/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pip/_vendor/urllib3/response.py”, line 425, in _error_catcher
yield
File “/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pip/_vendor/urllib3/response.py”, line 507, in read
data = self._fp.read(amt) if not fp_closed else b""
File “/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pip/_vendor/cachecontrol/filewrapper.py”, line 62, in read
data = self.__fp.read(amt)
File “/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py”, line 449, in read
n = self.readinto(b)
File “/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py”, line 493, in readinto
n = self.fp.readinto(b)
File “/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/socket.py”, line 586, in readinto
return self._sock.recv_into(b)
File “/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/ssl.py”, line 1009, in recv_into
return self.read(nbytes, buffer)
File “/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/ssl.py”, line 871, in read
return self._sslobj.read(len, buffer)
File “/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/ssl.py”, line 631, in read
v = self._sslobj.read(len, buffer)
socket.timeout: The read operation timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pip/_internal/cli/base_command.py”, line 153, in _main
status = self.run(options, args)
File “/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pip/_internal/commands/install.py”, line 382, in run
resolver.resolve(requirement_set)
File “/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pip/_internal/legacy_resolve.py”, line 201, in resolve
self._resolve_one(requirement_set, req)
File “/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pip/_internal/legacy_resolve.py”, line 365, in _resolve_one
abstract_dist = self._get_abstract_dist_for(req_to_install)
File “/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pip/_internal/legacy_resolve.py”, line 313, in _get_abstract_dist_for
req, self.session, self.finder, self.require_hashes
File “/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pip/_internal/operations/prepare.py”, line 194, in prepare_linked_requirement
progress_bar=self.progress_bar
File “/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pip/_internal/download.py”, line 465, in unpack_url
progress_bar=progress_bar
File “/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pip/_internal/download.py”, line 316, in unpack_http_url
progress_bar)
File “/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pip/_internal/download.py”, line 551, in _download_http_url
_download_url(resp, link, content_file, hashes, progress_bar)
File “/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pip/_internal/download.py”, line 253, in _download_url
hashes.check_against_chunks(downloaded_chunks)
File “/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pip/_internal/utils/hashes.py”, line 80, in check_against_chunks
for chunk in chunks:
File “/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pip/_internal/download.py”, line 223, in written_chunks
for chunk in chunks:
File “/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pip/_internal/utils/ui.py”, line 160, in iter
for x in it:
File “/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pip/_internal/download.py”, line 212, in resp_read
decode_content=False):
File “/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pip/_vendor/urllib3/response.py”, line 564, in stream
data = self.read(amt=amt, decode_content=decode_content)
File “/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pip/_vendor/urllib3/response.py”, line 529, in read
raise IncompleteRead(self._fp_bytes_read, self.length_remaining)
File “/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/contextlib.py”, line 99, in exit
self.gen.throw(type, value, traceback)
File “/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pip/_vendor/urllib3/response.py”, line 430, in _error_catcher
raise ReadTimeoutError(self._pool, None, “Read timed out.”)
pip._vendor.urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host=‘files.pythonhosted.org’, port=443): Read timed out.

直接在安装代码前加sudo 增加权限。pip3.6 install --target=/Users/liuxiling/virtualenv/virtualenvwrapper virtualenvwrapper
更改后
sudo pip3.6 install --target=/Users/liuxiling/virtualenv/virtualenvwrapper virtualenvwrapper
更改后会让你输入密码,输入密码后就可以了

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值