When a Python project needs a library, the first task is finding a package that fits what the code needs. pip installs Python packages from PyPI or another configured package index.
This article shows how to search PyPI by purpose and install the selected package into the intended Python environment.
TL;DR: Find packages on PyPI, not with pip search
PyPI no longer supports pip search, so search its website for a project and use pip to install the distribution you choose.
- Search by purpose or project name at pypi.org/search.
- Check the project page and copy its installation name.
- Run python -m pip install package-name in the intended environment.
What is pip, and where does it find packages?
pip is Python’s package installer. PyPI, the Python Package Index, is a public repository where project authors publish software distributions, and pip retrieves a chosen distribution from PyPI or another configured index.
PyPI’s website search is for people. During installation, pip queries an index through the Simple Repository API for compatible distributions. That “simple” endpoint is not PyPI’s website search page.
Distribution names used by pip can differ from import names in Python code. Check the project’s instructions when search results include similarly named projects.
How to find and install a Python package
Use PyPI to identify a project, then install it through the Python interpreter whose environment will run your code. The commands below use python3 on macOS or Linux. On Windows, the Python launcher form is usually py -m pip.
Step 1: Search PyPI by what the package does
Enter a purpose such as HTTP requests in PyPI’s search field. Open a candidate project and check its description, documentation link, supported Python versions and exact project name. Search results help locate candidates, but do not establish that a project is trustworthy or maintained.
The command pip search requests may look like the natural alternative, but it fails against PyPI now. I ran python3 pip_search_demo.py in this environment and received the following result:
safa@askpython:~$ python3 pip_search_demo.py
ERROR: XMLRPC request failed [code: -32500]
RuntimeError: PyPI no longer supports 'pip search' (or XML-RPC search). Please use https://pypi.org/search (via a browser) instead. See https://warehouse.pypa.io/api-reference/xml-rpc.html#deprecated-methods for more information.
exit code: 1
The error means PyPI retired XML-RPC search. pip docs note other indexes may still support the command, but use PyPI’s browser search for PyPI packages.
Step 2: Install the project in the right environment
After checking the project page, install its distribution name. For a project that publishes under the name requests, run:
python3 -m pip install requests
Using python3 -m pip ties pip to that interpreter, avoiding a bare pip command that might belong to a different Python installation. For project work, activate a virtual environment first, then run the install command there.
To install dependencies listed by an existing project, use its requirements file instead of searching for each name separately:
python3 -m pip install -r requirements.txt
This installs the requirements into the active environment. A requirements file records installation requirements. It does not decide which interpreter your application will use.
Why does pip search fail, and what should you check?
If pip search reports an XML-RPC error, PyPI’s search service is the issue, not a missing package name. Switch to the PyPI search page rather than repeatedly changing the command or its capitalization.
If installation says no matching distribution was found, check that you copied the project’s distribution name and that the package supports your Python version. pip may also be pointed at a private or alternate index, so inspect the configured index when the project page says a release exists.
If installation succeeds but Python cannot import the library, check that the program and pip use the same interpreter. Run python3 -m pip –version, then compare the Python path shown there with the interpreter running your code. An activated venv keeps that relationship explicit.
- XML-RPC search error: switch to PyPI’s website.
- No matching distribution: confirm the project name, Python support and configured index.
- Import error after installation: check the interpreter and active virtual environment.
Conclusion: Search PyPI, install with the target interpreter
PyPI’s website is the supported way to search its projects. pip installs the selected distribution into a Python environment. Use python -m pip rather than an ambiguous pip command, and keep project dependencies in a virtual environment when they should stay separate.
Can you search for a package with pip?
PyPI does not support pip search. Search for projects at pypi.org/search, then install the selected distribution with python -m pip install package-name.
Where does pip find packages?
pip installs from PyPI by default or from an index configured with pip options or settings. Its installation lookup uses the Simple Repository API, not the PyPI website’s human-facing search page.
How do I install packages from requirements.txt?
Activate the intended environment and run python -m pip install -r requirements.txt, using python3 on macOS or Linux when needed.

