   How to Run Pygames
  Damn, I would have thought this would be easy (probably is, but I'm missing something obvious I guess).  I'm at the pygame.org site, and there are a host of homemade pygames to try out.  But whenever I download the source code for a game, I can't seem to run it. Consider the platformer "John's Quest" here: http://www.pygame.org/project-John%27s+Quest-1484-.htmlI download and unzip the source code which creates a folder that I place with the rest of my projects in the python 3.1.1 main folder.Within the John's Quest folder are two sub folders (lib and res), and there is a single .py file called "run".   I double click the run file, but it doesn't do anything.  I open it up manually in python and there is very little code.  I run the module manually, but it just produces an error message. What am I doing wrong?It's like this for every game I try to run, I'm having the same problem no matter what game I try.   
Quote:Original post by CoryDI open it up manually in python and there is very little code.  I run the module manually, but it just produces an error message.What am I doing wrong?Not paying attention to the error message, which is telling you what the problem is. Yes, it's probably fairly cryptic at first, but it's chock-full of useful information.Copy it (if you can, otherwise re-type it) and paste it here so we can help you get your PyGaming fix on. [smile]   ;  Oluseyi is completely correct, but one thing that jumps to my mind is that you are using Python 3.1.1. I imagine that most of the games available there are written for Python 2.x.   ;Quote:Original post by OluseyiQuote:Original post by CoryDI open it up manually in python and there is very little code.  I run the module manually, but it just produces an error message.What am I doing wrong?Not paying attention to the error message, which is telling you what the problem is. Yes, it's probably fairly cryptic at first, but it's chock-full of useful information.Copy it (if you can, otherwise re-type it) and paste it here so we can help you get your PyGaming fix on. [smile]Alright, here it is:Traceback (most recent call last):File "C:\Python31\PyGames\BubbMan2-DX\run_game.py", line 6, in <module>import mainFile "lib\main.py", line 1, in <module>import retrogamelib as rglFile "C:\Python31\PyGames\BubbMan2-DX\retrogamelib\__init__.py", line 1, in <module>import display, button, dialog, gameobject, clock, font, util, constants, cameraImportError: No module named display:O;Quote:Original post by EzbezOluseyi is completely correct, but one thing that jumps to my mind is that you are using Python 3.1.1. I imagine that most of the games available there are written for Python 2.x.aha, yeah, I uninstalled 3.1.1 and installed the older 2.6.5 and I got the games to work.Never would have guessed a later version of python would undermine the validity of older programs for 2.6.5.  Kind of sucks.   ;Quote:Original post by CoryDaha, yeah, I uninstalled 3.1.1 and installed the older 2.6.5 and I got the games to work.You should be able to have 3.x and 2.x installed alongside each other, so long as you rename one of them and install to different locations. On my current machine I have 2.5, 2.6 and 3.0, I believe. The actual binaries are named python25, python26 and python30, with symbolic links wiring it up so that 2.6 is still my default installation (because that's still the sweet spot in terms of library and code support in the Python community right now).Glad you got it working, though. [smile]Quote:Never would have guessed a later version of python would undermine the validity of older programs for 2.6.5.  Kind of sucks.Indeed, it does. This is one of the caveats of interpreted (including bytecode interpreted and even potentially JIT-compiled) languages. Generally they are acceptable tradeoffs for the expressiveness of the language and immediacy of the REPL approach to iterative development, not to mention Python's interactive interpreter.   ;Quote:Original post by CoryDQuote:Original post by EzbezOluseyi is completely correct, but one thing that jumps to my mind is that you are using Python 3.1.1. I imagine that most of the games available there are written for Python 2.x.aha, yeah, I uninstalled 3.1.1 and installed the older 2.6.5 and I got the games to work.Never would have guessed a later version of python would undermine the validity of older programs for 2.6.5.  Kind of sucks.This is probably why it's actually pointed out on the official pygame for Windows download page:(python2.5.4 is the best python on windows at the moment)