Every time I try to run a program that imports pygame through Sublime Text it says: ImportError: No module named pygame.
How do I import pygame if I'm running the file on Sublime Text?
Jump to content
Posted 02 May 2013 - 01:46 PM
Your pygame folder needs to be installed in the folder where your current python version is installed. Here is my setup:
When you install pygame it will ask you to select the version of python to install to. You also need to verify that C:\Python27 is in your path system variable if you are using windows.
Posted 02 May 2013 - 02:17 PM
I have pygame installed. I have no idea where the files went or how to find them. There is no include folder in my Python 2.7 folder. I'm running Python 2.7 on a mac 10.8 os x.
Pygame works in IDLE just not when I try to launch it through Sublime Text.
Edited by ZorionBakar, 02 May 2013 - 02:18 PM.
Posted 02 May 2013 - 05:19 PM
My guess would be that Sublime's console uses its packaged copy of Python 3.x, rather than the system Python (which was Python 2.7, last I checked).
If I am correct, then you would need to figure out which directory Sublime keeps its python extensions in, and install a Python 3.x-compatible version of PyGame to that directory.
Edited by swiftcoder, 02 May 2013 - 05:20 PM.
Tristam MacDonald - Software Engineer @Amazon - [swiftcoding]