Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

pip install django timeout on MacOSX Lion

On a MBP, following instructions (http://techblog.rosedu.org/python-environment.html), I installed Xcode 4.4.1, brew (brew doctor says all set), and then python. Next, I tried to setup virtualenv:

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

I then created a virtual environment and tried to install django:

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

It downloads 98% and then hangs for a while, and finally I get a traceback indicating a timeout:

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

I see the same thing, if I just run the version of pip from /usr/local/bin/. I tried other packages (selenium, mock) and they downloaded and installed fine.

I'm at a loss as to what I may be doing wrong, or if there is some issue with django installs via pip. Advice?

like image 857
pcm Avatar asked Aug 27 '12 18:08

pcm


People also ask

How do I increase PIP timeout?

Increate pip timeout value We can use –timeout seconds argument to increase pip timeout value. textract is a python library. However, pip will try to read url if it finds error. We also can set pip retry times.

Can I PIP install Django?

Django can be installed easily using pip . In the command prompt, execute the following command: pip install django . This will download and install Django. After the installation has completed, you can verify your Django installation by executing django-admin --version in the command prompt.


1 Answers

Use:

pip --default-timeout=60 install django
like image 196
catherine Avatar answered Oct 07 '22 13:10

catherine