[Tutor] Importing Pygame
Dave Angel
davea at davea.name
Tue Jan 28 22:15:11 CET 2014
myles broomes <mylesbroomes at hotmail.co.uk> Wrote in message:
> _______________________________________________
> Tutor maillist - Tutor at python.org
> To unsubscribe or change subscription options:
> https://mail.python.org/mailman/listinfo/tutor
>
I'm guessing you're attempting to post here in this text newsgroup
using html. Please use text. It's a pain to quote your message
when none of it shows.
> And the error I get:
Traceback (most recent call last):
 File "C:\Python32\blankgame.py", line 1, in <module>
   import pygame,sys
ImportError: No module named 'pygame'
When I import pygame using the shell however, it works fine. I am
using Python 3.2.3 and the Pygame installer I downloaded is
pygame-1.9.2a0.win32-py3.2.msi.
Please be as specific as possible. Apparently you're running
Windows and when you run your Python script from a cmd shell, the
import works fine, but when you run it some other unspecified
way, you get the import error. You could learn a lot by printing
sys.path, the search path for import.
My guess is that you have two different installs of python, and
some difference in how you're launching the script is invoking
the different installations.
While you're investigating, please move your blankgame script
somewhere that's NOT in the installation directory. You'll only
confuse things when some things happen to sortof
work.
--
DaveA
More information about the Tutor
mailing list