问题
I am running virtualenvwrapper
and friends on Ubuntu 12.04 (virtualenvwrapper 1.7.1.2, virtualenv 1.7.1.2, pip 1.0, Distribute 0.6.24, Python 2.7). To be able to pip install matplotlib
I need a newer version of Distribute/setuptools, so I do the following:
$ mkvirtualenv new_venv
$ pip install matplotlib # fails
$ easy_install -U distribute
# installs Distribute 0.7.3 in the venv,
# which then installs setuptools 1.3.1
$ pip install matplotlib # works
However, when I run pip freeze
I get:
argparse==1.2.1
distribute==0.7.3 # here's Distribute
matplotlib==1.3.1
nose==1.3.0
numpy==1.8.0
pyparsing==2.0.1
python-dateutil==2.2
six==1.4.1
tornado==3.1.1
wsgiref==0.1.2
Where is setuptools
? I've tried just pip install setuptools
and it also fails to show up there.
回答1:
pip won't list packages that pip itself depends on unless you tell it to. You may include such packages by doing:
pip freeze --all
freeze lists packages in a requirements-format - for use in requirements files etc - while list is just that, a list.
See Pip freeze vs. pip list for more details.
回答2:
On Ubuntu setuptools
is installed by the systems package manager. So it is not listed when you pip freeze
. While creating a virtualenv, you will get these messages
mkvirtualenv test
New python executable in test/bin/python
Installing setuptools, pip...done.
If you do a pip freeze
immediately after this, you will get something like this
argparse==1.2.1
wsgiref==0.1.2
Here setuptools
and pip
wont be listed.
If you want everything you can do a pip list
which gives something like this.
argparse (1.2.1)
pip (1.5.6)
setuptools (3.6)
wsgiref (0.1.2)
来源:https://stackoverflow.com/questions/19837410/why-doesnt-setuptools-1-3-1-appear-when-i-pip-freeze