我对macOSX和virtualenv有问题。它似乎忽略了--没有现场-包裹。在linux (archlinux)中使用完全相同的命令,它可以工作。它使用python2.5实现了macOSX 10.5
curl -o virtualenv.py 'http://bitbucket.org/ianb/virtualenv/raw/tip/virtualenv.py创造新环境
python virtualenv.py --no-site-packages foo
New python executable in foo/bin/python
Installing setuptools...........................done.激活它
source foo/bin/activate试着在里面安装一些东西。尽管virtualenv,它仍在寻找系统范围的安装。
easy_install cherrypy
Searching for cherrypy
Best match: CherryPy 3.1.2
Adding CherryPy 3.1.2 to easy-install.pth file
Using /Library/Python/2.5/site-packages
Processing dependencies for cherrypy
Finished processing dependencies for cherrypy但是它找不到模块
(foo)guidage-multimodal:~ tristram$ python
Python 2.5.1 (r251:54863, Feb 6 2009, 19:02:12)
[GCC 4.0.1 (Apple Inc. build 5465)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import cherrypy
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named cherrypy在看了virtualenv --no-site-packages and pip still finding global packages?之后,我尝试了PIP,但是安装psycopg2失败了(gcc的一些问题)。另外,我希望能够有一个setup.py (来自分发版)来完成整个woork
更新在macOS 10.6上--它的工作原理是它应该正常工作。可能是python2.5太旧了,或者安装失败了,所以我放弃了,需要macOS 10.6.
发布于 2011-01-31 23:16:51
也可能是easy_install版本太老了。我建议使用pip:
easy_install pip
pip install virtualenv -U
virtualenv env
source env/bin/activate
pip -E env install cherrypyhttps://stackoverflow.com/questions/2990945
复制相似问题