I installed the pygame module and it works just fine when I try to run it from PyCharm or Sublime Text, but when I  try to run it from console or IDLE it says: " Error: No module named 'pygame' ".I should mention that my python 3.8 is not installed on it's default location, but rather on other partition in the custom folder. I also had problems with PATH and python when I first installed python.
Did you do import pygame at the beginning of the script? That may be the problem.
How to fix error: " No module named 'pygame' "