Python modules installed through MacPorts
MacOSX already includes the Python interpreter. However, if you install Python modules using MacPorts, you won’t be able to import them in your Python programs (ImportError: No module named <module name>).
The reason is that Apple’s Python doesn’t “see” the modules installed through MacPorts; you need to use MacPorts’s Python.
To see a list of available Python interpreters, run port select python. Then to choose e.g. MacPorts’s Python 2.6, run sudo port select python python26
Advertisement