为了账号安全,请及时绑定邮箱和手机立即绑定

为什么使用sudo pip install django 会报错

Exception:
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/pip/basecommand.py", line 209, in main
    status = self.run(options, args)
  File "/usr/lib/python2.7/dist-packages/pip/commands/install.py", line 328, in run
    wb.build(autobuilding=True)
  File "/usr/lib/python2.7/dist-packages/pip/wheel.py", line 748, in build
    self.requirement_set.prepare_files(self.finder)
  File "/usr/lib/python2.7/dist-packages/pip/req/req_set.py", line 360, in prepare_files
    ignore_dependencies=self.ignore_dependencies))
  File "/usr/lib/python2.7/dist-packages/pip/req/req_set.py", line 577, in _prepare_file
    session=self.session, hashes=hashes)
  File "/usr/lib/python2.7/dist-packages/pip/download.py", line 810, in unpack_url
    hashes=hashes
  File "/usr/lib/python2.7/dist-packages/pip/download.py", line 649, in unpack_http_url
    hashes)
  File "/usr/lib/python2.7/dist-packages/pip/download.py", line 871, in _download_http_url
    _download_url(resp, link, content_file, hashes)
  File "/usr/lib/python2.7/dist-packages/pip/download.py", line 595, in _download_url
    hashes.check_against_chunks(downloaded_chunks)
  File "/usr/lib/python2.7/dist-packages/pip/utils/hashes.py", line 46, in check_against_chunks
    for chunk in chunks:
  File "/usr/lib/python2.7/dist-packages/pip/download.py", line 563, in written_chunks
    for chunk in chunks:
  File "/usr/lib/python2.7/dist-packages/pip/download.py", line 552, in resp_read
    decode_content=False):
  File "/usr/share/python-wheels/urllib3-1.13.1-py2.py3-none-any.whl/urllib3/response.py", line 344, in stream
    data = self.read(amt=amt, decode_content=decode_content)
  File "/usr/share/python-wheels/urllib3-1.13.1-py2.py3-none-any.whl/urllib3/response.py", line 311, in read
    flush_decoder = True
  File "/usr/lib/python2.7/contextlib.py", line 35, in __exit__
    self.gen.throw(type, value, traceback)
  File "/usr/share/python-wheels/urllib3-1.13.1-py2.py3-none-any.whl/urllib3/response.py", line 240, in _error_catcher
    raise ReadTimeoutError(self._pool, None, 'Read timed out.')
ReadTimeoutError: HTTPSConnectionPool(host='pypi.python.org', port=443): Read timed out.

正在回答

4 回答

咦,超时了?

试试easy_install.

sudo easy_install django
0 回复 有任何疑惑可以回复我~

我开始也是的 后来直接用sudo apt-get install python-django -y安装就ok了

1 回复 有任何疑惑可以回复我~
#1

慕用1916611 提问者

行 我后面试试看 能解决就采纳你:-)
2016-11-04 回复 有任何疑惑可以回复我~

求助啊 

0 回复 有任何疑惑可以回复我~

我也遇到了,从最后一个异常看可能是网络不好导致读取超时了?

0 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消
django初体验
  • 参与学习       52941    人
  • 解答问题       79    个

本教程主要讲解Django基础入门知识,不容错过的Django初体验

进入课程

为什么使用sudo pip install django 会报错

我要回答 关注问题
意见反馈 帮助中心 APP下载
官方微信