I am running Snow Leapord 10.6 and trying to install the following python modules:
I'm having problems because OSX contains two versions of Python:
- / Library / Python /
- /System/Library/Frameworks/Python.framework/
It seems like when I execute the following command:
sudo easy_install -U {module} , the modules are installed in the package sites directory here:
bash-3.2$ ls -al /Library/Python/2.6/site-packages/ total 688 drwxrwxr-x 12 root admin 408 Aug 24 23:26 . drwxrwxr-x 3 root admin 102 Feb 11 2010 .. -rw-rw-r-- 1 root admin 119 Feb 11 2010 README -rw-r--r-- 1 root admin 267 Aug 24 19:03 easy-install.pth drwxr-xr-x 5 root admin 170 Aug 24 10:42 nose-0.11.4-py2.6.egg drwxr-xr-x 38 root admin 1292 Aug 24 15:35 numpy -rw-r--r-- 1 root admin 1618 Aug 24 15:35 numpy-2.0.0.dev8661-py2.6.egg-info drwxr-xr-x 16 root admin 544 Aug 24 19:07 numscons drwxr-xr-x 4 root admin 136 Aug 24 19:03 numscons-0.10.1-py2.6.egg -rw-r--r-- 1 root admin 265 Aug 24 19:07 numscons-0.12.0dev-py2.6.egg-info -rw-r--r-- 1 root admin 333959 Aug 23 11:51 setuptools-0.6c11-py2.6.egg -rw-r--r-- 1 root admin 30 Aug 23 11:51 setuptools.pth
But, when I try to install scipy, I see the following error:
config = setup_module.configuration(*args) File "scipy/setup.py", line 20, in configuration config.add_subpackage('special') File "/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/numpy/distutils/misc_util.py", line 851, in add_subpackage caller_level = 2) File "/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/numpy/distutils/misc_util.py", line 834, in get_subpackage caller_level = caller_level + 1) File "/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/numpy/distutils/misc_util.py", line 766, in _get_configuration_from_setup_py ('.py', 'U', 1)) File "scipy/special/setup.py", line 14, in <module> (numpy.__version__, numpy.__file__)) ValueError: numpy >= 1.4 is required (detected 1.2.1 from /System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/numpy/__init__.pyc)
So it looks like it is looking for an older version of numpy in my frameworks directory. I used import to find out which version of numpy python was:
python -c 'import numpy;print numpy.__version__' 1.2.1
And, of course, he is looking in the frameworks directory, although I have a new version sitting in:
/Library/Python/2.6/site-packages/
I know that import first looks for your local directory and then goes into PYTHONPATH and then finally looks at sys.path. So I checked them, and I don't have PYTHONPATH right now, and here is my sys.path:
/Library/Python/2.6/site-packages/setuptools-0.6c11-py2.6.egg /Library/Python/2.6/site-packages/nose-0.11.4-py2.6.egg /Library/Python/2.6/site-packages/numscons-0.10.1-py2.6.egg /System/Library/Frameworks/Python.framework/Versions/2.6/lib/python26.zip /System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6 /System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/plat-darwin /System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/plat-mac /System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/plat-mac/lib-scriptpackages /System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python /System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/lib-tk /System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/lib-old /System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/lib-dynload /Library/Python/2.6/site-packages /System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/PyObjC /System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/wx-2.8-mac-unicode
If I change PYTHONPATH to /Library/Python/2.6/site-packages and then check the numpy version, I get the correct version:
bash-3.2$ python -c 'import numpy; print numpy.__version__' 2.0.0.dev8661
But when I run sudo python setup.py build/install , scipy cannot find the number I need, even if PYTHONPATH is installed.
Can anyone help me here?
Found this link, which looks like it fixes my problem, but I can't get it to work:
http://andreasjacobsen.com/2008/10/10/using-python-setuptools-on-the-mac/