0

Okay, so I am brand new at this and I really need for this to be dumbed down for me. My python version is 2.7.9 and I downloaded pygame-1.9.1.win32-py2.7.msi and I am on a windows computer. I really need someone to explain why this is not working. I was reading on some of the other questions that you have to change the path of python and I have no idea how to do that. I am literally screwed because I have to turn something in for a major grade and I have literally been trying to figure this out for like about four weeks now.

When I try to import pygame, I get this error message and I have absolutely no idea what I am doing wrong:

Traceback (most recent call last): File "C:\Users\Tiffany\Documents\NetBeansProjects\NewPythonProject\src\newpythonproject.py", line 3, in import pygame ImportError: No module named pygame

Agnes
  • 21
  • 1
  • 3
  • possible duplicate of [ImportError: No module named 'pygame'](http://stackoverflow.com/questions/18317521/importerror-no-module-named-pygame). You should at least make a basic effort to solve the problem on your own; at the very least, you could do a simple search on the error message you received. – Ken White Mar 22 '15 at 02:52
  • You know what? Thanks for all the help internet. Ive been trying to "solve" this "problem" for about four weeks now. This whole thing has taken up my entire weekend. I have clicked on every possible website link to try to solve my problem. YEAH. Some basic effort alright. Taking up my entire weekend in trying to figure this out is more than a "basic effort". This is the first time I have asked a question for help and this is the type of "help" I get. @Ken White – Agnes Mar 22 '15 at 03:13
  • I found the link I provided in two seconds, by looking at the list of **Related** questions to the immediate right side of your question. It would have been shown to you as you typed your question here. If I could find it (and the other 7 questions related to ImportError that are in that same list, one of them again related to importing PyGame), how could you have been trying for four weeks and not been successful? You clearly didn't search here; Google also turns up the same posts using the same error message. We're glad to try and help, if you make a reasonable effort to help yourself first. – Ken White Mar 22 '15 at 03:20
  • I don't think you read my question clear enough. I am brand new at this and I just need it to be explained to me thoroughly. Every computer can have a different variation of problems that could be causing the same outcome. All because the same question is being asked, does not mean it always has the same solution. I have helped myself and I am still not understanding it. The first thing I did was look at all the related questions, how do you think I got here?? You ask questions to get answers so if you can't help me with my question, maybe someone else can. @Ken White – Agnes Mar 22 '15 at 03:40
  • Unfortunately, you're not really giving us much to go on. I'm hoping you ran the installer, but if not please go ahead and do that. Afterwards check your python directory, can you find a folder named "pygame" in the directory named "include"? If so, simply verify that it's not empty. – oxrock Mar 22 '15 at 04:14
  • I found the folder named include and it is not empty. Is there any other information that may be helpful? @oxrock – Agnes Mar 22 '15 at 04:39
  • Since you're having trouble anyway, you may as well download the latest pygame here: https://bitbucket.org/pygame/pygame/downloads The one you're looking for is "pygame-1.9.2a0.win32-py2.7.msi". If we're lucky, your import problems will resolve themselves there. If not, report back. – oxrock Mar 22 '15 at 04:48
  • Okay so one of the things I noticed when I downloaded this before, when it tells me to select where pygame should be installed, it doesn't give me an option to put it in the pygame folder. I did install it though. – Agnes Mar 22 '15 at 05:01
  • I meant it doesn't give me an option to put it in the python folder @oxrock – Agnes Mar 22 '15 at 05:09
  • oh yeah, and it is still giving me the same error message :/ @oxrock – Agnes Mar 22 '15 at 05:16
  • within the python directory there's the folder "include" and within that should be "pygame". If the pygame folder is there and it's not empty or anything bogus, then pygame should be properly installed. You responded to this earlier stating that it was indeed there. Also, your pygame version has to match your python version, so if you have python 64 installed, you'd need pygame 64 as well. Can you verify that your python install is 32? – oxrock Mar 22 '15 at 05:24
  • I know the computer is a 64 bit so if python is running correctly, the python that I have installed would have to be 64, correct? @oxrock – Agnes Mar 22 '15 at 05:35
  • You can run 32 bit python on a 64 bit machine. But trying to use 64 bit pygame would cause trouble. – oxrock Mar 22 '15 at 05:42
  • Okay so I went to C:/Pygame27/include and pygame is not in there but if I go to E:/PythonX/include, pygame is in there and not empty @oxrock – Agnes Mar 22 '15 at 05:53
  • either re-install pygame yet again while directing it to install to the python27 folder, or (not 100% this will work) try copying the pygame folder from the pythonx install and pasting it in the corresponding python27 location. Because I'm assuming that your python27 install is actually handling applications. – oxrock Mar 22 '15 at 06:00
  • So when I first tried to install pygame, and the installer asks where I would like it to be installed, It does not automatically give me the option to the pygame 27 folder like it should. I tried the second option, and it didn't work @oxrock – Agnes Mar 22 '15 at 06:07
  • The only options it gives me are: python from another location, will be installed on local hard drive, entire feature will be installed on local hard drive, feature will be installed when required, and entire feature will be unavailable. When I was watching tutorials, the same screen popped up on various computers all giving them the option to install on the python27 file. @oxrock – Agnes Mar 22 '15 at 06:10
  • and what happened when you manually moved the file? – oxrock Mar 22 '15 at 06:37
  • It gives me the same error message and So when I reinstalled it, its giving me another option: Python from registry to install it into – Agnes Mar 22 '15 at 06:40
  • Last thing I can think to suggest is to uninstall all installations of python and to try again fresh. It's my last resort, hail Mary solution. If that doesn't solve the problem then I'm out of ideas. Unfortunately trouble shooting python related module installation issues isn't exactly my forte. – oxrock Mar 22 '15 at 07:12
  • One last thing, i believe I misspoke before when explaining pygame's location. Check for it in Python27\Lib\site-packages – oxrock Mar 22 '15 at 07:24
  • Anyways, thanks for all the help. I really appreciated it. I will try those things. :) @oxrock – Agnes Mar 22 '15 at 07:34

1 Answers1

0

There is only really only one way to do this:

  • Create a folder

  • Put the Python Interpreter you are using in that folder

  • Put the PyGame module you are using in that same folder

And your problem is now solved. I hope this helps you!

Anthony Pham
  • 3,096
  • 5
  • 29
  • 38