Search code examples
pythonmacosscipyosx-mavericks

OSX 10.9.2 Pylab suddenly not importing


I recently wanted to mess around with Vpython and followed the instructions on this site: http://vpython.org/contents/download_mac.html

Before this point, I had python up and running on my laptop and installed libraries using macports. Since following the installation steps described on the Vpython page, I can no longer use any of my scipy related libraries. For example, when importing numpy it just says

ImportError: No module named pylab

Also, when looking in /Library/Python/2.7/site-packages/ scipy isn't present, even though macports says py27-scipy is installed (and I've tried reinstalling).
I'm guessing the python install (which I naively thought was standalone) that I preformed when installing Vpython has messed up a path or something and I'm not quite sure how to fix it.


Solution

  • Most likely your shell PATH has been modified so that another Python is being found before the MacPorts one, the one that has Pylab installed to it. Try typing /opt/local/bin/python2.7, assuming you've used the default MacPorts install prefix.

    MacPorts Pythons do not install into /Library/Python or /Library/Frameworks.