I installed Pygame Snippets in my Visual Studio Code and then i wrote import pygame
, i always got an error
import pygame
ModuleNotFoundError: No module named 'pygame'
I looked for any ways how to fix it at the web, but nothing helped me.
I installed Pygame Snippets in my Visual Studio Code and then i wrote import pygame
, i always got an error
import pygame
ModuleNotFoundError: No module named 'pygame'
I looked for any ways how to fix it at the web, but nothing helped me.
Pygame Snippets is just an extension on vscode. It does not install Pygame for you. Follow the getting started page for Pygame to install.
You should installl pygame package from pip, not snippets.
Snippets is a vscode feature that help you fast coding with code templates.
I had similar issue in vs code, basically I had 2 python installed one from microsoft store and another one from vs code software. To solve this I just uninstalled the one from microsoft store and installed pygame by
pip install pygame
now I am able to access the module.
install pygame module through powershell:
Use the command pip install pygame
To actually install pygame
you need to do it from command line/terminal. The command to install is pip install pygame
If you click on the dropdown button on the right of the run Button, you can click on: 'Run Python File' or 'Debug Python File'. That worked out for me.