I am running macports to install scipy and such on OS X leopard with python 2.7. The install runs successfully, but running python and trying to import the packages I've installed, they're not found.

What I'm running is:

sudo python_select python27 
sudo port install py27-wxpython py27-numpy py27-matplotlib 
sudo port install py27-scipy py27-ipython

Opening up python in interactive mode (it is the correct version of python), I type 'import scipy' and get a module not found error. What gives? How can I find out where it is installing the packages to instead?

link|improve this question
How do you start python - what bersion does it print at the start and what is the value of sys.path? – Mark Dec 15 '10 at 22:22
feedback

2 Answers

MacPorts installs Python 2.7 packages at /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages. Check to make sure that this path is in sys.path in Python. SciPy would be installed in scipy under that directory. Also check port contents py27-scipy to ensure that the files are in the right place.

link|improve this answer
If that path is not in sys.path, how can I add it? – xmaslist Dec 11 '10 at 17:48
1  
If you're running MacPorts Python located at /opt/local/bin/python then it should already be added for you. Are you sure you are running the right Python? Is /opt/local/bin in your PATH? – fideli Dec 11 '10 at 19:08
feedback
port contents py27-scipy

confront this with the ouput of:

import sys
from pprint import pprint
pprint(sys.path)
link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.