With pip list
, we can see the install packages in our environment. There is no problem with that. We can also write them to a req.txt file with pip freeze and quickly load them in other environments with this req.txt file. My question here is, for example, when we install pandas
, libraries such as numpy
are installed with them, and we can see other libraries installed outside of pandas with pip list
. Can I use an option with pip list
to see only the main libraries I have installed here? For example, is there an option to show only pandas (no libraries like numpy) when I do a pip list?
Asked
Active
Viewed 383 times
2

dede
- 47
- 4
-
"Can I use an option with pip list to see only the main libraries I have installed here?" Usually that information should be found in the setup.py, setup.cfg, or pyproject.toml of the project. – flakes Jan 30 '23 at 07:11
1 Answers
6
You can use --not-required
flag. This will list packages that are not dependencies of installed packages.
python -m pip list --not-required
or if pip
is in $PATH
pip list --not-required

Abdul Niyas P M
- 18,035
- 2
- 25
- 46