pip search¶
Problem¶
By default, pip search
searches packages on PyPI.org from the command line. However, the team are considering removing it, because they think it’s not that useful and using too many resources on PyPI (PyPI XMLRPC search has been disabled because of abuse/overuse).
Research¶
Prior to PyPI XMLRPC search being disabled, we:
Gathered feedback on pip search via the “buy a feature” survey
Published a survey specifically about pip search, asking users about:
Their current use of pip search
How useful they find pip search results
How clear they find pip search results
Where users expect pip to search (e.g. PyPI vs private index)
What data pip should search other than project name
What changes or additions they would make to pip search
Results¶
In total, we received 1070 responses to the buy a feature survey, with 541 (50.4%) respondents selecting “Search pypi.org for packages” in their top 10 features.
However, search ranked lower than the following features:
Run pip without requiring any user input (e.g. in CI) 718
Show information about all installed packages 707
Show information about a single installed package 596
We received 302 responses to the pip search survey, with 62 of the 302 (20.5%) respondents either not knowing that the command existed, never using it, or using it “rarely”.
We found that the remaining ~80% of respondents who do use pip search use it to:
Find/search for the right/new/alternate packages to install:
Checking package name (verify correct spelling)
Assessing functionality (check a package’s description)
Verifying availability (check if such package exists)
Search for the latest version of a package (verify version)
Find package libraries and new modules
In general, pip search is regarded as:
more useful than not useful
more clear than not clear
When asked if pip should search on items other than the package name, respondents most commonly asked to search the package description:
Some users also mentioned that they would like the search to be configurable, e.g. by passing flags/options.
When asked how they would improve pip search, users said they would improve:
1. Search methods:
fuzzy search and insensitive case should be acceptable
users should have the option to filter/sort by description, name, tag
2. Search results:
relevancy: the results should show both the exact match and closest match
order/category: the result should display items in a certain order, e.g highest number of downloads (popularity), development status (last updated/latest version), etc.
there should be a limited number of search results
3. User interface:
link package to pypi page
use color coding / system for better clarity
distinguish exact match search results from others: by highlighting, or using a different color
indicate version compatibility
Recommendations¶
Deprecation strategy¶
Given that the PyPI search API is currently disabled (as of 1st Jan, 2021) for technical and sustainability reasons, we recommend that the pip team display a clear error message to users who use the command:
The PyPI search API has been disabled due to unmanageable load.
To search PyPI, open your browser to search for packages at https://pypi.org
Alternatively, you can search a different index using the --index command.
In the longer term, we recommend that the PyPI team investigate alternative methods of serving search results (e.g. via caching) that would enable pip search to work again. This recommendation is supported by our research which suggests that many pip users find this functionality useful.
If this is not possible, the pip team should create clear instructions that tells users what to use instead. Some suggestions (based on common user flows) are listed below:
Verifying the latest version of a package¶
Users also use the pip search
command to find or verify a particular package’s version.
As a replacement, the pip team could do either of the following:
Extend the
pip show
feature to include known latest versions of the package;Create a
pip outdated
command which scans the current dependency tree and outputs the packages that are outdated (compared to the latest versions on the configured index).
UX improvements¶
Should it be possible to continue to support pip search, we strongly recommend the following UX improvements:
Adding support for fuzzy search, or suggesting alternative/related search terms
Adding support for case insensitive search
Searching based on a package’s description
Linking search results to a package’s PyPI page (where appropriate)
Other user feedback (as detailed above) should also be considered by the team on a case-by-case basis.