PIP安装MacOSX上狮子的Django超时(pip install django timeout

2019-07-31 05:02发布

在MBP,下面的说明(http://techblog.rosedu.org/python-environment.html),我安装的Xcode 4.4.1,BREW(BREW医生说,所有的设置),然后蟒蛇。 接下来,我试图建立的virtualenv:

> $MYPYTHON/bin/python distribute_setup.py
> $MYPYTHON/bin/easy_install pip
> $MYPYTHON/bin/pip install virtualenv

然后我创建了一个虚拟环境,并试图安装Django:

> $MYPYTHON/bin/virtualenv $MYENV
> $MYENV/bin/pip install Django

它下载98%,然后挂了一段时间,最后我得到的跟踪信息超时:

pcm@pcm-mac[302]% $MYENV/bin/pip install django
Downloading/unpacking django
  Downloading Django-1.4.1.tar.gz (7.7Mb): 7.5Mb downloaded
Exception:
Traceback (most recent call last):
  File "/Users/pcm/Documents/workspace/virtual/lib/python2.7/site-packages/pip-1.1-py2.7.egg/pip/basecommand.py", line 104, in main
    status = self.run(options, args)
  File "/Users/pcm/Documents/workspace/virtual/lib/python2.7/site-packages/pip-1.1-py2.7.egg/pip/commands/install.py", line 245, in run
    requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
  File "/Users/pcm/Documents/workspace/virtual/lib/python2.7/site-packages/pip-1.1-py2.7.egg/pip/req.py", line 985, in prepare_files
    self.unpack_url(url, location, self.is_download)
  File "/Users/pcm/Documents/workspace/virtual/lib/python2.7/site-packages/pip-1.1-py2.7.egg/pip/req.py", line 1109, in unpack_url
    retval = unpack_http_url(link, location, self.download_cache, self.download_dir)
  File "/Users/pcm/Documents/workspace/virtual/lib/python2.7/site-packages/pip-1.1-py2.7.egg/pip/download.py", line 451, in unpack_http_url
    download_hash = _download_url(resp, link, temp_location)
  File "/Users/pcm/Documents/workspace/virtual/lib/python2.7/site-packages/pip-1.1-py2.7.egg/pip/download.py", line 368, in _download_url
    chunk = resp.read(4096)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/socket.py", line 380, in read
    data = self._sock.recv(left)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 553, in read
    s = self.fp.read(amt)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/socket.py", line 380, in read
    data = self._sock.recv(left)
timeout: timed out

我看到同样的事情,如果我只是从/ usr / local / bin目录/运行PIP的版本。 我试过其他包(硒,模拟),他们下载并安装罚款。

我在一个无所适从我可能是做错了,或者如果有一些问题和Django通过PIP安装。 建议吗?

Answer 1:

使用:

pip --default-timeout=60 install django


文章来源: pip install django timeout on MacOSX Lion