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

陌路散爱 提交于 2021-02-05 12:58:11

问题


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.

回答1:


To search for a package, issue the command

pip search [package-name]



回答2:


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.




回答3:


  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/




回答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.




回答5:


To see a list of all available packages try running

pip search *


来源:https://stackoverflow.com/questions/17373473/how-do-i-search-for-an-available-python-package-using-pip

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!