Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

pip search django produces time out error

Tags:

python

pip

django

coincidentally, I run pip search django command and I got time out error. even specifing a high value of timeout

Below the logs:

D:\PERFILES\rmaceissoft\virtualenvs\fancy_budget\Scripts>pip search django --timeout=300
Exception:
Traceback (most recent call last):
  File "D:\PERFILES\Marquez\rmaceissoft\Workspace\virtualenvs\fancy_budget\lib\s
ite-packages\pip-1.1-py2.7.egg\pip\basecommand.py", line 104, in main
    status = self.run(options, args)
  File "D:\PERFILES\Marquez\rmaceissoft\Workspace\virtualenvs\fancy_budget\lib\s
ite-packages\pip-1.1-py2.7.egg\pip\commands\search.py", line 34, in run
    pypi_hits = self.search(query, index_url)
  File "D:\PERFILES\Marquez\rmaceissoft\Workspace\virtualenvs\fancy_budget\lib\s
ite-packages\pip-1.1-py2.7.egg\pip\commands\search.py", line 48, in search
    hits = pypi.search({'name': query, 'summary': query}, 'or')
  File "C:\Python27\Lib\xmlrpclib.py", line 1224, in __call__
    return self.__send(self.__name, args)
  File "C:\Python27\Lib\xmlrpclib.py", line 1575, in __request
    verbose=self.__verbose
  File "C:\Python27\Lib\xmlrpclib.py", line 1264, in request
    return self.single_request(host, handler, request_body, verbose)
  File "C:\Python27\Lib\xmlrpclib.py", line 1297, in single_request
    return self.parse_response(response)
  File "C:\Python27\Lib\xmlrpclib.py", line 1462, in parse_response
    data = stream.read(1024)
  File "C:\Python27\Lib\httplib.py", line 541, in read
    return self._read_chunked(amt)
  File "C:\Python27\Lib\httplib.py", line 574, in _read_chunked
    line = self.fp.readline(_MAXLINE + 1)
  File "C:\Python27\Lib\socket.py", line 476, in readline
    data = self._sock.recv(self._rbufsize)
timeout: timed out

Storing complete log in C:\Users\reiner\AppData\Roaming\pip\pip.log

however, another search command finish without problems:

pip search django-registration

Is that a bug of pip due to the big amount of packages name that contains "django"?

Note: speed internet connection = 2 Mbits

like image 281
rmaceissoft Avatar asked Mar 23 '12 22:03

rmaceissoft


2 Answers

the --timeout option doesn't seem to work properly.

I can install django properly by using either:

pip --default-timeout=60 install django

or

export PIP_DEFAULT_TIMEOUT=60
pip install django

Note: using pip version 1.2.1 on RHEL 6.3

Source: DjangoDay2012-Brescia.pdf, page 11

like image 160
sp1111 Avatar answered Oct 02 '22 23:10

sp1111


The pypi is probably overloaded. Just enable mirror fallback and caching in pip. Maybe tune the timeout a bit. Add these in ~/.pip/pip.conf:

[global]
default-timeout = 60
download-cache = ~/.pip/cache

[install]
use-mirrors = true
like image 25
ionelmc Avatar answered Oct 02 '22 23:10

ionelmc