Recently when I run the command pip search pygame in a terminal, it show me the error message like RuntimeError: PyPI’s XMLRPC API is currently disabled due to unmanageable load and will be deprecated in the near future. This article will tell you how to fix it.
1. How To Reproduce The Error.
- Open a terminal and run the command pip search pygame in it, then the error will happen.
- Below are the detailed error messages.
$ pip search pygame ERROR: XMLRPC request failed [code: -32500] RuntimeError: PyPI's XMLRPC API is currently disabled due to unmanageable load and will be deprecated in the near future. See https://status.python.org/ for more information.
2. Why This Error Happen?
- The reason for this error is that the pip search command has been deprecated and banded. Because the PyPI XMLRPC API has received so many search calls ( hundreds of thousands ) per hour since Nov 14, 2020.
- You can go to the remove the pip search command page to see the detailed explanation.
- But fortunately, there are some alternatives we can use to implement the pip search function.
3. Alternative Methods To Search PyPI Repository.
3.1 Search Python Packages In The PyPI Official Website.
- Go to the https://pypi.org/ official website.
- Input the python module name in the Search projects input text box.
- Click the Search button to search, then you can see the search result list.
3.2 Use PyPi Simple Search.
- PyPi simple search is a tool that is developed by Jeffrey M Moore, it provides the pip search function.
- Below are the steps of how to use it.
- Go to the PyPi simple search GitHub website.
- Click the bin folder link to go to the executable file page.
- There are 2 script files on the page, pip-pss, and pypi-simple-search.
- The script file pip-pss wraps the pypi-simple-search function.
- The script file pypi-simple-search contains the bash code that can search the PyPi repository.
- You can copy the pypi-simple-search script file content, paste it to your local file pypi-simple-search and save it.
- Then open a terminal and run the command chmod +x pypi-simple-search to add executable permission to the script file.
$ chmod +x pypi-simple-search $ ls -al total 8 drwxr-xr-x 3 songzhao staff 96 Jan 16 15:23 . drwxr-xr-x 11 songzhao staff 352 Jan 16 15:22 .. -rwxr-xr-x 1 songzhao staff 3989 Jan 16 15:23 pypi-simple-search
- Now you can run the file $ . ./pypi-simple-search pygame as below.
$ . ./pypi-simple-search pygame Updating cache of PyPi packages blinka-displayio-pygamedisplay ...... vext.pygame
- If you use Windows, you can use Cygwin to run the above script. You can read the article How To Install Cygwin On Windows Correctly to learn more.