I'm having an error while using Pygame. I'm using Python 3.5 and Pygame 3.2. I started to learn Pygame just today and it gives me this error:
Code:
import pygame
pygame.init()
width, height = 640, 480
screen=pygame.display.set_mode((width, height))
player = pygame.image.load("resources/images/dude.png")
while 1:
screen.fill(0)
screen.blit(player, (100,100))
pygame.display.flip()
for event in pygame.event.get():
if event.type==pygame.QUIT:
pygame.quit()
exit(0)
ERROR:
Traceback (most recent call last):
File "test.py", line 5, in <module>
pygame.init()
AttributeError: module 'pygame' has no attribute 'init'
pygame.pyin the directory you're runningtest.pyfrom (or elsewhere in your PYTHONPATH) that's shadowing the real pygame module.