Sublime Forum

I can't import pygames in SublimeText

#1

I’m brand new to coding and just tried using Sublime to create a window in python.

import pygame
pygame.init()

screenwidth= 800
screenheight= 600

screen= pygame.display.set_mode((screenwidth, screenheight))

This is the answer I get when I try to run it:

Traceback (most recent call last):
File “C:\Users\Me\OneDrive\Documents\python apps\preppy.py”, line 1, in
import pygame
ModuleNotFoundError: No module named ‘pygame’
[Finished in 1.1s]

I’ve been trying for hours to find an answer but every answer I see assumes I understand all the confusing terminology, so if someone can explain the steps with easier language I’d appreciate it!

0 Likes

#2

See the installation instructions for pygame: https://web.archive.org/web/20260702122742/https://www.pygame.org/wiki/GettingStarted#Pygame%20Installation

Note that Sublime Text just runs the python installed on your system, so any problems with that python are unrelated to Sublime Text.

0 Likes