Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

python

macos

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 from 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.

like image 872
Robert Avatar asked Apr 23 '10 10:04

Robert


2 Answers

pip install python-dateutil

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

like image 87
Santiago Angel Avatar answered Sep 27 '22 17:09

Santiago Angel


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.

like image 20
Michael Aaron Safyan Avatar answered Sep 27 '22 16:09

Michael Aaron Safyan