当我创建一个新的virtualenv时,pip freeze
显示我已经安装了几个包,即使我没有在环境中安装任何东西。我希望pip freeze
返回空输出,直到我的第一个pip install
进入环境之后。wsgiref is part of the standard library不是吗,那它为什么会出现呢?
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
一些额外信息:
(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"
要回答一个稍有不同的问题:如果由于某种原因不幸拥有了
wsgiref
(以及任何其他类似有问题的.egg
文件),可以通过执行pip freeze -l
,而不是pip freeze
。pip help freeze
描述此选项:每次您创建一个virtualenv时--没有站点包,它都会安装
setuptools
或distribute
。而之所以出现wsgiref
,是因为python 2.5+标准库向wsgiref
lib提供egg信息(而pip
不知道它是stdlib还是第三方包)。好像是在Python3.3+:http://bugs.python.org/issue12218上解决的
相关问题 更多 >
编程相关推荐