Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
212 views
in Technique[技术] by (71.8m points)

python - pip search django produces time out error

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
maceissoftvirtualenvsfancy_budgetScripts>pip search django --timeout=300
Exception:
Traceback (most recent call last):
  File "D:PERFILESMarquez
maceissoftWorkspacevirtualenvsfancy_budgetlibs
ite-packagespip-1.1-py2.7.eggpipasecommand.py", line 104, in main
    status = self.run(options, args)
  File "D:PERFILESMarquez
maceissoftWorkspacevirtualenvsfancy_budgetlibs
ite-packagespip-1.1-py2.7.eggpipcommandssearch.py", line 34, in run
    pypi_hits = self.search(query, index_url)
  File "D:PERFILESMarquez
maceissoftWorkspacevirtualenvsfancy_budgetlibs
ite-packagespip-1.1-py2.7.eggpipcommandssearch.py", line 48, in search
    hits = pypi.search({'name': query, 'summary': query}, 'or')
  File "C:Python27Libxmlrpclib.py", line 1224, in __call__
    return self.__send(self.__name, args)
  File "C:Python27Libxmlrpclib.py", line 1575, in __request
    verbose=self.__verbose
  File "C:Python27Libxmlrpclib.py", line 1264, in request
    return self.single_request(host, handler, request_body, verbose)
  File "C:Python27Libxmlrpclib.py", line 1297, in single_request
    return self.parse_response(response)
  File "C:Python27Libxmlrpclib.py", line 1462, in parse_response
    data = stream.read(1024)
  File "C:Python27Libhttplib.py", line 541, in read
    return self._read_chunked(amt)
  File "C:Python27Libhttplib.py", line 574, in _read_chunked
    line = self.fp.readline(_MAXLINE + 1)
  File "C:Python27Libsocket.py", line 476, in readline
    data = self._sock.recv(self._rbufsize)
timeout: timed out

Storing complete log in C:Users
einerAppDataRoamingpippip.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

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...