Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?

share|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
add comment

2 Answers

port contents py27-scipy

confront this with the ouput of:

import sys
from pprint import pprint
pprint(sys.path)
share|improve this answer
add comment

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.

share|improve this answer
    
If that path is not in sys.path, how can I add it? –  xmaslist Dec 11 '10 at 17:48
2  
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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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