2

I'm trying to get pygame working with portable python 3.2.1.1 running off a USB stick, but when I use the following code:

import pygame, sys

It says:

ImportError: No module named pygame

My understanding was that pygame came embedded in portable python. Can anyone help?

avasal
  • 14,350
  • 4
  • 31
  • 47
pluke
  • 3,832
  • 5
  • 45
  • 68

2 Answers2

3

Pygame does not come embeded in portable python 3.2. Tho it comes in the 2.7 version.

Sources: http://portablepython.com/wiki/PortablePython3.2.1.1 - 3.2 (No pygame here!) http://portablepython.com/wiki/PortablePython2.7.3.1 - 2.7 (Pygame embeded!)

Willy
  • 635
  • 8
  • 18
  • You are correct, my sources were wrong! Is there any way of 'splicing' it in? I know it works with python 3.x – pluke Oct 29 '12 at 10:27
  • Yes it works with 3.x (I myself use it) on a "normal install" of python. Some people suggest that you install pygame on a computer and then copy over the files to your usb-stick with pp installed on. Im not able to verify if it works or not though. – Willy Oct 29 '12 at 10:30
  • Problem we're locked down on a network only able to run stuff from USB, no ability to install (school environment). I can probably download the pygame files and try to splice them in myself, but not sure how easy this is – pluke Oct 29 '12 at 10:40
  • I had exactly the same problem myself, hopefully you will succeed where I failed. Good luck and most importantlly, have fun! – Willy Oct 29 '12 at 10:43
2

Running Pygame on Portable Python....

On Windows 7 download and copy the msi file into your portable directory. Double-click the msi file. When prompted for the directory, change to the USB drive. Once done, copy the library and site packages contents to the USB library and site packages.

To test, bring up Python interpreter, then type "import pygame".

If successful, you will not receive an error when importing.

C.C. Mayo
  • 21
  • 1