Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 17217

Pygame works with python.exe and IDLE but not in VS Code and PyInstaller [duplicate]

$
0
0

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)

Viewing all articles
Browse latest Browse all 17217

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>