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
134 views
in Technique[技术] by (71.8m points)

python - error using pip search (pip search stopped working)

Error image

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.'>              
See Question&Answers more detail:os

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

1 Reply

0 votes
by (71.8m points)

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.

See this GitHub issues thread ...

The solution I am using for now is to pip install pip-search (a utility created by GitHub user @victorgarric).

So, instead of 'pip search', I use pip_search. Definitely beats searching PyPI via a web browser


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

...