Find all packages installed with easy_install/pip?
Master System Design with Codemia
Enhance your system design skills with over 120 practice problems, detailed solutions, and hands-on exercises.
Introduction
If you want to list installed Python packages, the modern answer is almost always pip, not easy_install. The real challenge is usually not the command itself. It is making sure you are querying the correct Python environment.
That matters because the same machine may have multiple interpreters, multiple virtual environments, and sometimes both pip-managed and conda-managed packages. A package list is only meaningful if it belongs to the interpreter your application actually uses.
Start With the Interpreter, Not Just pip
The safest pattern is to run pip through the interpreter directly:
This is better than calling plain pip because it removes ambiguity about which Python executable owns that package set.
If you have multiple Python versions installed, the difference is important. pip on your PATH may not be the same environment as the python command you use to run your app.
Use pip list for a Human-Readable Inventory
When the goal is simple inspection, use:
That gives a readable table of package names and versions. If another tool needs to parse the results, JSON output is available:
This is useful in diagnostics, scripts, and CI environments where you want structured output rather than a formatted table.
Use pip freeze for Reproducible Snapshots
If you want a pinned list that can be reused later, pip freeze is more appropriate:
Or write it to a file:
The mental model is:
- '
pip listfor humans' - '
pip freezefor environment snapshots'
Do not confuse the two. They serve related but different purposes.
What About easy_install?
easy_install is legacy tooling from the older setuptools era. You may still encounter environments that were originally touched by it, but it is not the normal package-management interface in modern Python workflows.
If you suspect an older environment contains packages from mixed installation history, inspect the installed distributions directly rather than relying on easy_install itself:
That reads the installed distribution metadata from the active environment and is often a more reliable audit mechanism than historical tooling names.
Check Virtual Environments Explicitly
Before trusting any package list, confirm the environment:
In a virtual environment, those paths should point inside the virtual environment directory. If they do not, you may be listing global packages while debugging a local venv problem, or vice versa.
For conda-based environments, you may need both:
That is because conda and pip can both contribute packages to the same environment.
Programmatic Reporting Inside Python
Sometimes you want the package inventory from inside a running process, not from a shell. importlib.metadata works well for that too:
This is useful for support bundles, internal diagnostics, and environment-reporting endpoints.
Common Pitfalls
The most common mistake is querying the wrong interpreter. A package may appear to be "missing" simply because pip list was run against a different Python installation.
Another common issue is treating easy_install as a current first-class workflow. In modern Python, it is mostly historical context rather than the right tool for package inspection.
Developers also confuse pip list and pip freeze. One is a readable inventory, while the other is closer to a reproducible snapshot.
Finally, hybrid environments can mislead you. If conda and pip both manage packages, one command may not tell the whole story.
Summary
- Use
python -m pip listto inspect installed packages in the active Python environment. - Use
python -m pip freezewhen you want a pinned snapshot for reproducibility. - Treat
easy_installas legacy and use modern metadata tools for auditing old environments. - Always verify which interpreter and environment you are querying.
- Use
importlib.metadatawhen you need package inventories from inside Python itself.

