I'm encountering a peculiar issue with Pygame where it works perfectly fine when running a script using python.exe or Python IDLE, but it fails to work in Visual Studio Code (VS Code) and when packaged with PyInstaller. I've tried various troubleshooting steps without success.
Python Version: Python 3.12.0Pygame Version: (2.5.2)Operating System: windows 10Virtual Environment: No
Code:
import pygamepygame.init()
Error Message:
pygame.init() ^^^^^^^^^^^AttributeError:partially initialized module 'pygame' has no attribute 'init' (most likely due to a circular import)