Using pygame on mac?

I tried to get pygame on my Mac to work. I got it in the terminal. But I am encountering problems when trying to use it with netbeans or trying to run a file. It gives me an error

from pygame.locals import * ImportError: No module named locals 

any help? Thanks!

+4
source share
1 answer

If you still want to use netbeans, I think you should take a look at ActivePython

Activepython basically allows you to install different pythons on your computer and be able to choose between them (there are many more features that I'm sure).

My advice would be to go to the console and type

 >python >>> from pygame.locals import * 

If this works, ctrl-c out and run python -v to find out the version.

Once you have a version, you can use activepython to select this version by running: sudo pysel [version]. For example, for python2.7: sudo pysel 2.7

This should switch python, and your netbeans should (hopefully) work with it.

+1
source

All Articles