Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

pip

virtualenv

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.

like image 461
holys Avatar asked Apr 12 '13 02:04

holys


People also ask

Where are packages installed in virtualenv?

Similar to your system's Python installation, the packages are stored inside lib/python2. */site-packages/ directory.

How do I list installed packages in pip?

To do so, we can use the pip list -o or pip list --outdated command, which returns a list of packages with the version currently installed and the latest available. On the other hand, to list out all the packages that are up to date, we can use the pip list -u or pip list --uptodate command.

How do I see what Python modules are installed?

To check all the installed Python modules, we can use the following two commands with the 'pip': Using 'pip freeze' command. Using 'pip list command.


1 Answers

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.

like image 108
Ioannis Filippidis Avatar answered Sep 22 '22 14:09

Ioannis Filippidis