Skip to content Skip to sidebar Skip to footer

Getting Pygame To Import In Python Interpreter After Macports Install

I'm trying to start using the pygame module but I can't get it to run. I'm using Mountain Lion with Python 2.7 and MacPorts, but I also installed some science and math modules usin

Solution 1:

Ok, so I figured out the problem, and it was my path. I went in and removed the anaconda package with:

rm -r ~/anaconda

Then, I used macports to basically reinstall the whole scipy stack with:

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

This took some time to compile, and when it was finished I went in on the command line and used:

sudo port select --set python python27

After that I opened my interpreter and imported all my scientific computing needs without a problem and pygame, which I had installed earlier with macports. I hope this helps someone else in the future. ALSO: when you remove packages like anaconda, make sure and close your terminal and then re-open it or it will still try to use the dependancies of anaconda, which are no longer there. I had macports set up already so after removing anaconda the macports path became the default.

One last edit. In order to get all of this to run correctly and allow me to run the scripts from within emacs as well with all the imported modules I had to switch to aquamacs from my normal emacs editor in order for the correct path to be used from within the emacs environment , or I could have just run emacs from the terminal with /Application/Emacs.app/Contents/MacOS/Emacs.

Post a Comment for "Getting Pygame To Import In Python Interpreter After Macports Install"