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.
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.
You can list only packages in the
virtualenv
bypip freeze --local
orpip list --local
. This option works irrespective of whether you have global site packages visible in thevirtualenv
.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.
Calling
pip
command inside a virtualenv should list the packages visible/available in the isolated environment. Make sure to use a recent version of virtualenv that uses option--no-site-packages
by default. This way the purpose of using virtualenv is to create a python environment without access to packages installed in system python.Next, make sure you use
pip
command provided inside the virtualenv (YOUR_ENV/bin/pip
). Or just activate the virtualenv (sourceYOUR_ENV/bin/activate
) as a convenient way to call the proper commands for python interpreter or pipWhat's strange in my answer is that package 'wsgiref' is visible inside the virtualenv. Its from my system python. Currently I do not know why, but maybe it is different on your system.
In my case the flask version was only visible under so I had to go to C:\Users\\AppData\Local\flask\venv\Scripts>pip freeze --local
If you're still a bit confused about
virtualenv
you might not pick up how to combine the great tips from the answers by Ioannis and Sascha. I.e. this is the basic command you need:That can be easily used elsewhere. E.g. here is a convenient and complete answer, suited for getting all the local packages installed in all the environments you set up via virtualenvwrapper:
list out the installed packages in the virtualenv
step 1:
step 2:
it will display the all installed packages and installed packages and versions