我正在运行安装了python 2.6和2.7的Mac OS X Lion 10.7.1。我已经制作了2.6我的默认版本。我正在尝试安装一个软件包,它安装到2.7。我的设置如下:
~:hi› which python
/usr/bin/python
~:hi› python -V
Python 2.6.6
~:hi› python
Python 2.6.6 (r266:84292, Jun 16 2011, 16:59:16)
[GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.prefix
'/System/Library/Frameworks/Python.framework/Versions/2.6'
>>> sys.exec_prefix
'/System/Library/Frameworks/Python.framework/Versions/2.6'
不应该安装在2.6站点包中吗?我误解了这应该如何运作?
修改
有问题的套餐是virtuanenvwrapper
我的2.6默认版本是这样的:
defaults write com.apple.versioner.python Version 2.6
我尝试像这样安装:
sudo python setup.py install
sudo /usr/bin/python setup.py install
答案 0 :(得分:3)
当setup.py
安装Python软件包时,它不会关注Apple系统设置。它唯一知道的是你用来调用它的Python版本。如果你说:
python2.6 setup.py …
然后使用该版本,与
相同python2.7 setup.py …
如果您使用这两个命令中的第一个,那么包是否安装在2.6之下?我的猜测是sudo
运行的shell可能默认为2.7,无论你的普通shell想要使用哪个Python。如果你说:
sudo python -V