0

I installed pygame using pip install pygame and when that didn't work I found a solution online and tried pip install pygame==2.0.0.dev14. Still the same problem: "pygame" shows up when I do pip list, and pygame folders are there in the file locations. However, when I run the code import pygame, the shell shows the error ModuleNotFoundError: No module named 'pygame'.

How can I fix this?

Tomerikoo
  • 18,379
  • 16
  • 47
  • 61

2 Answers2

0

You should do pip3 install pygame sometimes this happens, when you are on a mac and have 2 versions of python in your computer, MAC OS takes the python 2.7 by default, if you want a newer version, you have to specify by saying python3 or pip3

Oliver Hnat
  • 797
  • 4
  • 19
0

For python 3.9, you can use: python -m pip install pygame --pre --user. This happens because python 3.9 isn't fully adapted to pygame yet.

GGberry
  • 929
  • 5
  • 21