How do you know where macports installs python packages to?
Solution 1
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.
Solution 2
port contents py27-scipy
compare this with the ouput of:
import sys
from pprint import pprint
pprint(sys.path)
Related videos on Youtube
xmaslist
Updated on September 17, 2022Comments
-
xmaslist over 1 year
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?
-
mmmmmm over 13 yearsHow do you start python - what bersion does it print at the start and what is the value of sys.path?
-
-
xmaslist over 13 yearsIf that path is not in sys.path, how can I add it?
-
fideli over 13 yearsIf 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 yourPATH
? -
Valeriy Van over 9 yearsThanks! Always wanted to know such command as port contents.