Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

i can't import pygame in visual studio code

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.

like image 786
Author Climent Avatar asked Mar 12 '26 22:03

Author Climent


2 Answers

Pygame Snippets is just an extension on vscode. It does not install Pygame for you. Follow the getting started page for Pygame to install.

like image 77
Kent Shikama Avatar answered Mar 15 '26 11:03

Kent Shikama


You should installl pygame package from pip, not snippets.

Snippets is a vscode feature that help you fast coding with code templates.

like image 45
Nate Scarlet Avatar answered Mar 15 '26 10:03

Nate Scarlet



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!