trouble using pygame

Quentin Bock qberz2005 at gmail.com
Fri Mar 5 21:54:05 EST 2021


So, I recently downloaded the pygame module, this code is from a youtube
tutorial by the way, I am following along the tutorial, the error involves
the pygame.init() and also says this:

import pygame

# Initialize Pygame
pygame.init()

#create the screen
screen = pygame.display.set_mode((800, 600))

# Game Loop
running = True
while running:
    for event in pygame.event.get():
        if event.type == pygame.quit():
            running = False

The error says "partially initialized module 'pygame' has no attribute
'init' (most likely due to a circular import)

If someone could also explain what a circular import is and how to
avoid them within the future that would be great

Thanks :)

Here is a link to the tutorial  as well just in case someone wants to see it:

https://www.youtube.com/watch?v=FfWpgLFMI7w


More information about the Python-list mailing list