gpt4 book ai didi

python - pip search django 产生超时错误

转载 作者:太空狗 更新时间:2023-10-29 22:05:56 25 4
gpt4 key购买 nike

巧合的是,我运行 pip search django 命令时出现超时错误。甚至指定一个高超时值

日志下方:

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

然而,另一个搜索命令完成时没有问题:

pip search django-registration

是不是 pip 的一个 bug 是因为大量的包名包含“django”?

注意互联网连接速度 = 2 Mbits

最佳答案

--timeout 选项似乎无法正常工作。

我可以使用以下任一方式正确安装 django:

pip --default-timeout=60 install django

export PIP_DEFAULT_TIMEOUT=60
pip install django

注意:在 RHEL 6.3 上使用 pip 版本 1.2.1

来源:DjangoDay2012-Brescia.pdf, page 11

关于python - pip search django 产生超时错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9847470/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com