Compilation Error. Attributeerror: 'module' Object Has No Attribute 'init'
Here is my small program, import pygame pygame.init() Here is my compilation command. python myprogram.py Compilation error, File 'game.py', line 1, in import pygame
Solution 1:
Delete the "pygame.py" file in your Documents folder, it is shadowing the real pygame you've installed.
It looks like you first saved your small test program as "pygame.py", then renamed it to "game.py".
Solution 2:
Solution 3:
Rename pygame.py to another_name_as_pygame.py and this is your new Code:
import pygame
from pygame.localsimport *
pygame.init()
Post a Comment for "Compilation Error. Attributeerror: 'module' Object Has No Attribute 'init'"