I was trying to make a simple snake game in Python so I installed Pygame using pip install Pygame. After I installed it successfully, I tried importing Pygame but I got this error:
ModuleNotFoundError: No module named 'pygame'
I'm new to python so I'm really stuck. I imported the module by the code.
import pygame
if you are on windows:
open cmd and then type:
cd\
cd /d C:\Windows
cd /d C:\Users\username\AppData\Local\Programs\Python\Python37\Scripts
and then type the command:
pip install pygame
if you are on Mac:
just try python -m pip install pygame
if you are on linux:
pip install pygame
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With