Interaction between pygame and python

Rick Johnson rantingrickjohnson at gmail.com
Mon Mar 14 12:53:51 EDT 2016


On Monday, March 14, 2016 at 3:28:40 AM UTC-5, Tyson wrote:
> I am having a lot of trouble getting python to find the
> pygame module; my operating system is Windows 7.  Can you
> offer any help?  . Should I download pygame into the same
> folder as Python? . any ideas at all?

If you're new to Python, or even programming in general, i
would highly suggest that you download a pygame executable
installer, and not source code. 

Typically, the you'll want third party libraries, and that's
what pygame *IS*, a third party library, to be installed into
your "PythonXY/Lib/site-packagages" folder. 

If you download and run an installer, one that is
appropriate for your operating system and Python version,
everything will be taken care of for you.

Since you are using Python 3.5.1 on a windows box, you'll
want to download and install the executable named
"pygame-1.9.1-py3.1.msi". You can get it here:

  http://www.pygame.org/download.shtml

Also, have a look at this page for some helpful "getting
started" info:

  http://www.pygame.org/wiki/GettingStarted

After you run the installer, open up a fresh Python shell,
and try to import pygame again. If that import fails, come
back here and post the full traceback.

> Python 3.5.1 (v3.5.1:37a07cee5969, Dec  6 2015, 01:38:48)
> [MSC v.1900 32 bit (Intel)] on win32
> 
> >>> import pygame
> 
> Traceback (most recent call last):
> 
>   File "<pyshell#0>", line 1, in <module>
> 
>    import pygame
> 
> ImportError: No module named 'pygame'
> 
> >>> import pygame, sys

Just FYI: importing the "sys" module won't help. If pygame
is not there, it's not there -- plain and simple. 

Now, it could be that you *DO* have pygame installed. but
Python cannot find it. But the best thing for you to do at
this time, is to uninstall any current versions of pygame,
and/or delete any files belonging to pygame from your
computer, and start fresh by running the installer.



More information about the Python-list mailing list