使用 pip 搜索时出错(pip 搜索停止工作) [英] error using pip search (pip search stopped working)
问题描述
我在学习 python 时在 pip 搜索中遇到了这个错误.图片是我pip搜索时的错误.你能告诉我怎么解决吗?
I am getting this error in pip search while studying python. The picture is an error when I pip search. Can you tell me how to fix it?
$ pip search pdbx
ERROR: Exception:
Traceback (most recent call last):
File "*/lib/python3.7/site-packages/pip/_internal/cli/base_command.py", line 224, in _main
status = self.run(options, args)
File "*/lib/python3.7/site-packages/pip/_internal/commands/search.py", line 62, in run
pypi_hits = self.search(query, options)
File "*/lib/python3.7/site-packages/pip/_internal/commands/search.py", line 82, in search
hits = pypi.search({'name': query, 'summary': query}, 'or')
File "/usr/lib/python3.7/xmlrpc/client.py", line 1112, in __call__
return self.__send(self.__name, args)
File "/usr/lib/python3.7/xmlrpc/client.py", line 1452, in __request
verbose=self.__verbose
File "*/lib/python3.7/site-packages/pip/_internal/network/xmlrpc.py", line 46, in request
return self.parse_response(response.raw)
File "/usr/lib/python3.7/xmlrpc/client.py", line 1342, in parse_response
return u.close()
File "/usr/lib/python3.7/xmlrpc/client.py", line 656, in close
raise Fault(**self._stack[0])
xmlrpc.client.Fault: <Fault -32500: 'RuntimeError: This API has been temporarily disabled due to unmanageable load and will be deprecated in the near future. Please use the Simple or JSON API instead.'>
推荐答案
pip search 命令查询 PyPI 的服务器,PyPI 的维护者已经解释说 pip search 命令查询的 API 端点是非常资源密集型的,而且对于他们来说太昂贵了始终向公众开放.因此,他们有时会限制访问,并且实际上计划很快将其完全删除.
The pip search command queries PyPI's servers, and PyPI's maintainers have explained that the API endpoint that the pip search command queries is very resource intensive and too expensive for them to always keep open to the public. Consequently they sometimes throttle access and are actually planning to remove it completely soon.
请参阅此 GitHub 问题线程 ...
我现在使用的解决方案是 pip install pip-search
(由 GitHub 用户 @victorgarric 创建的实用程序).
The solution I am using for now is to pip install pip-search
(a utility created by GitHub user @victorgarric).
因此,我使用 pip_search 而不是pip search".绝对胜过通过网络浏览器搜索 PyPI
So, instead of 'pip search', I use pip_search. Definitely beats searching PyPI via a web browser
这篇关于使用 pip 搜索时出错(pip 搜索停止工作)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!