How can I make a list of installed packages in a certain virtualenv?

holys picture holys · Apr 12, 2013 · Viewed 104.2k times · Source

You can cd to YOUR_ENV/lib/pythonxx/site-packages/ and have a look, but is there any convenient ways?

pip freeze list all the packages installed including the system environment's.

Answer

Ioannis Filippidis picture Ioannis Filippidis · Jul 9, 2014

You can list only packages in the virtualenv by pip freeze --local or pip list --local. This option works irrespective of whether you have global site packages visible in the virtualenv.

Note that restricting the virtualenv to not use global site packages isn't the answer to the problem, because the question is on how to separate the two lists, not how to constrain our workflow to fit limitations of tools.

Credits to @gvalkov's comment here. Cf. also this issue.