2010-06-07 20 views
2

我遇到了macOSX和virtualenv的問題。它似乎忽略--no-site-package。 使用完全相同的命令與Linux(archlinux)它的作品。它,它的MacOSX 10.5與Python 2.5virtualenv macosX - 無地址包忽略

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 

然而,但是它沒有安裝psycopg2(的一些問題用gcc沒有找到該模塊

(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 )。此外,我希望能夠有一個setup.py(從分發),這是整個woork

更新在macOS 10.6它工作,因爲它應該工作。也許是蟒蛇2.5到老,或安裝是壞的,所以我放棄,將需要macOS 10.6 ...

回答

1

它也可能是easy_install版本太舊了。 我建議使用點子:

easy_install pip 
pip install virtualenv -U 
virtualenv env 
source env/bin/activate 
pip -E env install cherrypy