Skip to content Skip to sidebar Skip to footer

'pygame' Is Not Defined

I've already installed the pygame(1.9.1 v). Here is my code: # 1 - Import library import pygame from pygame.locals import * import math import random # 2 - Initialize the game pyg

Solution 1:

You have a file named pygame.py in your Desktop folder and it is masking the pygame library:

import pygame
File "C:\Users\George\Desktop\pygame.py", line 6, in <module>

Note that the line import pygame imported the file C:\Users\George\Desktop\pygame.py.

Rename that file to something else or remove it altogether.

Post a Comment for "'pygame' Is Not Defined"