164

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.
0

10 Answers 10

171

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 search <package> 

Update [2023-05-01]: Altenative: [pip_search](https://github.com/victorgarric/pip_search) is an alternative to pip search and using shell aliases, one can overwrite the pip search with the actual execution of pip_search (complements to Johan)


Sign up to request clarification or add additional context in comments.

6 Comments

for a minimalistic package name search perhaps wget -O - https://pypi.org/simple/ | grep -i [package name] You can then get more info if desired at https://pypi.org/project/ [project name] (The match from the grep command between >....<)
"minimalistic" indeed: pypi.org/simple is 290,000 package names 0 .. zzzZZZzzz, that's it; /project/ has only links to tar / whl. Does anyone know of a pypi mirror with only package*.dist-info for querying (yolk, qypi), no wheels ?
The Answer to the Question is "You Can't." The ONLY answers are work-arounds at this point. status.python.org/incidents/grk0k7sz6zkp => "Resolved: XMLRPC Search has been permanently disabled. Jan 03, 2022"
poetry so far seems a solid replacement for this missing functionality. Install e.g., either as: pip3 install --user poetry (or pip2), or e.g., macOS you either use pip or can also sudo port install poetry (if using macports). See pypi.org/project/poetry
pip search x-package-name can be used with the pip_search package and an alias bash script described here to the file where you inserted the script e.g. .bash_alias. Then just run source ~/.bash_alias and it will work immediately.
|
84

To search for a package, issue the command

pip search [package-name] 

4 Comments

Also, if anyone forgets the command you can find it by typing into the command line: pip -h
"SEARCH" does NOT work anymore (this is by desing) (as of 01/2021) - see stackoverflow.com/a/65485498/4940240 answer ny @azcarbea below
I'm getting "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 status.python.org for more information."
This is so far out of date, it should be removed.
53

As of December the 14th, 2020, the pip search functionality has been disabled :

$ pip search cast 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. 

Alternatives

Here's a little tool called pip_search I've just found that does a simple search but it does the job.

This is pip_search v0.0.6 output:

$ pip_search pulsemixer ---------------- ------------------------------------------------------------------------------- Name Description pulsemixer pulsemixer - CLI and curses mixer for PulseAudio pulsectl-asyncio Asyncio frontend for the pulsectl Python bindings of libpulse pulsectl Python high-level interface and ctypes-based bindings for PulseAudio (libpulse) ---------------- ------------------------------------------------------------------------------- 

UPDATE

pip_search has been updated, each folder is a clickable (CTRL+click) URL for each project, now it looks like this:

$ pip_search pulsemixer 🐍 https://pypi.org/search/?q=pulsemixer 🐍 ┏━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ ┃ Package ┃ Version ┃ Released ┃ Description ┃ ┡━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━╇━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩ │ 📂 pulsemixer │ 1.5.1 │ Apr 11, 2020 │ pulsemixer - CLI and curses mixer for PulseAudio │ │ 📂 pulsectl-asyncio │ 0.1.7 │ Jun 13, 2021 │ Asyncio frontend for the pulsectl Python bindings of libpulse │ │ 📂 pulsectl │ 21.5.18 │ May 22, 2021 │ Python high-level interface and ctypes-based bindings for PulseAudio (libpulse) │ └─────────────────────┴─────────┴──────────────┴─────────────────────────────────────────────────────────────────────────────────┘ 

To install it, just type:

pip install pip_search


There's also another tool that I've just tried called pypisearch.

To install it, just type: pip install pypisearch

And it works like this:

$ python -m pypisearch pulsemixer pulsemixer (1.5.1) [installed 1.5.0] pulsemixer - CLI and curses mixer for PulseAudio pulsectl-asyncio (0.1.5) Asyncio frontend for the pulsectl Python bindings of libpulse pulsectl (21.3.4) Python high-level interface and ctypes-based bindings for PulseAudio (libpulse) 

1 Comment

Note that this simply sends a query term to pypi.org/search
26

After Dec 2020, search doesn't work. But index does.

pip index versions <package_name>

EDIT: (You can also use pip index -vv versions <package> to get verbose output.)

2 Comments

Don't want to necro, but this works fine for me in pip 21.2.3 while pip search is deprecated and was blocked by my work vpn. I understand why pip search is the accepted answer, but it's not really a solution going forward with newer versions of pip. While experimental, at least this solution is not deprecated.
This answer is simple to implement because there is nothing to install. It works fine for me on Windows as of 2022.11.04.
12
  1. To search use pip search QUERY

    Use pip help and pip help COMMAND to learn about all available commands and their options.

  2. You can find a complete list of packages here:

    https://pypi.org/

    An index with simpler markup for easier automatic consumption can be found here:

    https://pypi.org/simple/

2 Comments

what version of pip are you talking about?
Now the url without the trail slash is the one to go!
4

Pip search can solve your problem if you don't want to use it too often. But after regular use I found it hard to read, slow to use and it didn't show infos I sometimes needed (upload time, license, size, etc) so I ended up writing an alternative which I think turned out pretty nice.

It is called yip and it is like pip search on steroids. It supports regex search, colorized output and a menu system which makes installing from search result super easy. If you want to know more or see a screencap check it out on GitHub.

Comments

2

To see a list of all available packages try running

pip search * 

5 Comments

then you can pipe to grep. kind of like yum list | grep PATTERN.
I just did that, got a list of 102 packages. Asterisk does not appear to work as wildcard. I believe it finds actual asterisk somewhere in the package description. Did a few other tests with asterisk with no apparent system to the results.
Note that star * is a glob in many shells, so it will expand to a list of filenames in the current directory. You could get around that by escaping it with quotes or a backslash.
I got no results from this using pip 19.1.1.
It shows exactly 100 packages + 2 log lines (pip 20.0.2). pip search has max display packages count.
1

Just simply install a non-existing version of the package that you want to search. By this way, you can find not only the stable releases, but also the alpha, beta versions like 1.2.3a2.

pip install [package]==666.666.666 

1 Comment

Or simply pip install packagename==
1

As of today, none of the historical workarounds (poetry search, pip_search, yip, etc.) are reliable anymore:

  • pip search was permanently disabled in Dec 2020 when PyPI shut down the XML‑RPC API.
  • poetry search only works inside a Poetry project and no longer provides a global search.
  • pip_search is abandoned and broken because PyPI changed its HTML structure.
  • yip also fails because it still depends on the deprecated XML‑RPC API.

So if you try any of these, you’ll either get errors, crashes, or empty results.


A simple, working alternative

Instead of relying on broken wrappers, you can query PyPI’s official /simple/ index or JSON API directly. Here’s a minimal script (pipsearch.py) that mimics pip search by scanning the /simple/ index:

# pipsearch.py import requests, sys def search(term): r = requests.get("https://pypi.org/simple/") pkgs = [line.split(">")[-1].split("<")[0] for line in r.text.splitlines() if term.lower() in line.lower()] for name in pkgs[:20]: print(name) if __name__ == "__main__": if len(sys.argv) < 2: print("Usage: pipsearch <term>") else: search(sys.argv[1]) 

Usage:

python pipsearch.py vosk 

Example output:

ovos-stt-plugin-vosk ovos-ww-plugin-vosk pyvosklivesubtitle transkription-vosk vosk vosk-autosrt vosk-cli voskIntentVoiceConvertHanzi vosk-model-ko vosk-tts yairmoldovosk 

Notes

  • This script is intentionally minimal: it just lists matching package names.
  • You can extend it to fetch descriptions and versions via the JSON API (https://pypi.org/pypi/<package>/json).
  • If you want muscle memory, alias pip search to call this script.

In short: all the old tools are dead because they relied on XML‑RPC. The only future‑proof way is to use PyPI’s JSON or Simple API directly.

Comments

0

Just use pip list | grep <package_name>

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.