开发者

Installing dateutils on OS X. How can I install to a different version of Python

I am trying to install dateutils on OS X 10.6. When I run python setup.py install it installs fine but to the Python 2.6 directory. I need to use Python 2.5 which is the "default" python version. By this I mean that when I run python f开发者_如何学运维rom the command line it loads Python 2.5.4.

Is there a way to install modules to specific versions of Python. I have not had a problem like this before as normally it installs to the version of Python I have set as default.


pip install python-dateutil

Answer from this question asking for the same thing but for Windows: How to install python-dateutil on Windows?


What version of Mac OS X are you using, what is your PATH, and did you install the other version of Python using MacPython, or did you install it via MacPorts? On Mac OS X 10.6 Snow Leopard, the following command works just fine at installing dateutils in the system's version of Python.

sudo easy_install -O2 dateutils

Note, though, that if your second installation of Python also has a copy of the setuptools installed, and if that version's easy_install utility overshadows the default in the PATH, then this will install to the other Python.


Typically you should have the also a python2.5 in the path:

python2.5 setup.py install
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜