When I create a fresh virtualenv, pip freeze
shows that I have a couple of packages installed even though I've not installed anything into the environment. I was expecting pip freeze
to return empty output until after my first pip install
into the environment. wsgiref is part of the standard library isn't it, so why does it show up at all?
day@garage:~$ mkdir testing day@garage:~$ cd testing day@garage:~/testing$ virtualenv --no-site-packages . New python executable in ./bin/python Installing distribute.......................................................... ............................................................................... .........................................done. day@garage:~/testing$ . bin/activate (testing)day@garage:~/testing$ pip freeze distribute==0.6.10 wsgiref==0.1.2
Some extra info:
(testing)day@garage:~/testing$ pip --version pip 0.7.2 from /home/day/testing/lib/python2.7/site-packages/pip-0.7.2-py2.7.eg g (python 2.7) (testing)day@garage:~/testing$ deactivate day@garage:~/testing$ virtualenv --version 1.4.9 day@garage:~/testing$ which virtualenv /usr/bin/virtualenv day@garage:~/testing$ dpkg -S /usr/bin/virtualenv python-virtualenv: /usr/bin/virtualenv day@garage:~/testing$ cat /etc/lsb-release DISTRIB_ID=Ubuntu DISTRIB_RELEASE=11.04 DISTRIB_CODENAME=natty DISTRIB_DESCRIPTION="Ubuntu 11.04"
Show activity on this post. 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 .
pip freeze is a very useful command, because it tells you which modules you've installed with pip install and the versions of these modules that you are currently have installed on your computer. In Python, there's a lot of things that may be incompatible, such as certain modules being incompatible with other modules.
If this command returns Can not perform a '--user' install. User site-packages are not visible in this virtualenv. then you are already in a Python virtual environment. You will need to deactivate this environment or contact your system administrator to install virtualenv for you in this environment.
Everytime you create a virtualenv with --no-site-packages it installs setuptools
or distribute
. And the reason wsgiref
appears is because python 2.5+ standard library provides egg info to wsgiref
lib (and pip
does not know if it stdlib or 3rd party package).
It seems to be solved on Python3.3+: http://bugs.python.org/issue12218
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With