Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I search for an available Python package using pip?

Tags:

python

pip

I would like to be able to search for an available Python package using pip (on the terminal). I would like a functionality similar to apt-cache in Ubuntu. More specifically, I would like to

  1. be able to search for packages given a term (similar to apt-cache search [package-name]), and
  2. list all available packages.
like image 790
CodeKingPlusPlus Avatar asked Jun 28 '13 20:06

CodeKingPlusPlus


People also ask

How do I search for pip packages?

pip search Looking for a package, pip is there to help you out. pip search allows you to search PyPI for any package using the pip search <package> command. The result of the command returns the name and description of all the matching packages.

How do I know if a Python package is available?

The Pip, Pipenv, Anaconda Navigator, and Conda Package Managers can all be used to list installed Python packages. You can also use the ActiveState Platform's command line interface (CLI), the State Tool to list all installed packages using a simple “state packages” command.

How do I get a list of modules in pip?

There are three ways to get the list of all the libraries or packages or modules installed in python using pip list command, pip freeze command and help function . This will list all the modules installed in the system .

Where does pip install search for packages?

pip looks for packages in a number of places: on PyPI (if not disabled via --no-index ), in the local filesystem, and in any additional repositories specified via --find-links or --index-url .


2 Answers

As of Dec 2020, pip search will not work (more).

The current feasible solution is to search online, on: https://pypi.org/ (reference also provided by previous comments).

If anyone hitting the following error:

xmlrpc.client.Fault: <Fault -32500: "RuntimeError: PyPI's XMLRPC API has been temporarily disabled due to unmanageable load and will be deprecated in the near future. See https://status.python.org/ for more information."> 

as stated in #5216:

As an update: XMLRPC search does still remain disabled.

because:

As noted in #5216 (comment), a group of servers are hitting the pip search entry point, to an extent that PyPI cannot sustain that load with the current architecture of how pip search works.

Update: As a CLI alternative to pip, that uses PyPI registry, one can use poetry:

$ poetry search <package> 
like image 88
azbarcea Avatar answered Nov 07 '22 23:11

azbarcea


To search for a package, issue the command

pip search [package-name] 
like image 31
ijmarshall Avatar answered Nov 07 '22 23:11

ijmarshall