Sign in to follow this  
llamaSong

Pygame Help!

Recommended Posts

Okay, So I have the Mac version of python and pygame. So I open up Chimp.py which is an example that comes with pygame. I click Run All. I get: ImportError: No MOdule Named pygame Traceback (innermost last) File "chimp.py",line 11,in? import os,pygame. How do I fix this/

Share this post


Link to post
Share on other sites
Well, first of all, there shouldn't be a period at the end of that import statement. Second of all, it doesn't look like you properly installed pygame. What I'd do is read over the instructions again and make sure you didn't miss something.

Share this post


Link to post
Share on other sites
Sometimes there are multiple versions of python (particularly on OSX), which each use a different module directory. How did you install Pygame? From the source? If so, try running Chimp.py from the command line.

Share this post


Link to post
Share on other sites
Quote:
Original post by Roboguy
Sometimes there are multiple versions of python (particularly on OSX), which each use a different module directory. How did you install Pygame? From the source? If so, try running Chimp.py from the command line.


Theres a period at the end just cause I put one there.
I installed pygame by taking the pkg and doubleclicking it then clicking next until it finished instaling.

Share this post


Link to post
Share on other sites
Okay, so Instalations tells me to instal the binaray packages first from this link. Aparantly both the instructions and all the packages are at this link and will instal all dependecies.
http://undefined.org/python/pimp/
The problem is that there are 6billion downloads and no instructions at that sight.

Share this post


Link to post
Share on other sites
Quote:
Original post by Roboguy
Quote:
Original post by llamaSong
So which one do I download?
They're all unrelated python packages, the one you want is the pygame one.


Okay, but I installed py game by double clicking the package. After instaling it, I went to examples and ran "Chimp.py" it sayed Pygame module could not be found error.

Share this post


Link to post
Share on other sites
Quote:
Original post by llamaSong
Quote:
Original post by Roboguy
Quote:
Original post by llamaSong
So which one do I download?
They're all unrelated python packages, the one you want is the pygame one.


Okay, but I installed py game by double clicking the package. After instaling it, I went to examples and ran "Chimp.py" it sayed Pygame module could not be found error.
Are you running Chimp.py from the terminal or by double clicking it? Try double-clicking it, if you tried to run it from the terminal.

Share this post


Link to post
Share on other sites
Quote:
Original post by Genjix
in konqueror press F4 to bring up the konsole.

$ chmod 755 chimp.py
$ ./chimp.py

thats it!
He might not have Konqueror (He's on OS X). Go into /Applications/Utilities and open Terminal.app. That should bring up a standard bash (or tcsh) prompt. Then type in (after you cd into the appropriate directory):

echo "#!/usr/bin/env python" >Chimp.new.py
cat Chimp.py >>Chimp.new.py
chmod 755 Chimp.new.py
./Chimp.new.py
If you want, you can rename Chimp.new.py after this by typing mv Chimp.new.py Chimp.py, but you might want to make sure it works first since that would overwrite the old Chimp.py.

Share this post


Link to post
Share on other sites
Quote:
Original post by llamaSong
Typed in what you said. Heres what I got :(
-bash: !/usr/bin/env: event not found
Sounds like you forgot the double quotes around #!/usr/bin/env python

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this