I have recently installed PyGame in Python, but something strange happens. When I import it and use it in the terminal, it works fine, but when I try to use it in idle
it doesn't work at all. Does someone know why does this happens?
import pygame
pygame.init()
win = pygame.display.set_mode((500, 500))
Exits with the error:
>Traceback (most recent call last):
File "C:/Users/USER/PycharmProjects/Primer Python/Basico/pygame.py", line 1, in <module>
import pygame
File "C:\Users\USER\PycharmProjects\Primer Python\Basico\pygame.py", line 2, in <module>
pygame.init()
AttributeError: module 'pygame' has no attribute 'init'