-1

I'm using Python 2.7 32 bit and have a few questions about pygame on mac.

Where do the files go when you install it? I'm not given a choice for the file path when I install it.

When I import pygame in IDLE everything works fine (except it's a bit slow to load sometimes), but when I import pygame and run Python using Sublime Text (what would this be called, the key board short-cut is command-b for build), it can not find pygame. I'm assuming I have to find the library and move it to a different place but I can't find it.

When I run a file that imports pygame in the terminal everything works out fine too. Maybe there's a better text editor to use?

I'm new to programming and I'm realizing that its probably a good idea to get more acquainted with how my mac works/ is organized. Any good resources for this?

2
  • Are you sure that wherever pygame is installed is on your path?
    – Haz
    May 2, 2013 at 21:19
  • I don't know where pygame is installed or where my path is. May 2, 2013 at 21:27

1 Answer 1

0

Just go to Tools->Build System->New Build System and make sure the json file that pops up looks exactly like this:

{
    "shell_cmd": "python2.7-32"
}

Save it as "python2_32.sublime-build" or something that lets you know what it is, then you can go to tools->Build System and select your new build directive. Now when you Command-B, your code should run fine.

This essentially lets sublime text know that you want to run this script using the 32 bit version of python (which supports pygame). It's like a shebang for sublime.

Good luck!

Not the answer you're looking for? Browse other questions tagged or ask your own question.