Python Forum

Full Version: ModuleNotFoundError: No module named 'pygame'
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
(i'm on ubuntu)
i went to the terminal and typed pip install pygame. Then when I tried to import it on pycharm, it didn't work. I did things like checking if i was missing something (pip check pygame) turns out I was missing something so then I went ahead and downloaded it. Went back to pycharm and still, the error came 'ModuleNotFoundError: No module named 'pygame''. I checked if pygame was there; (pip list) and there it was pygame (1.9.6). So what is wrong?!?
need to install pygame:
# from command line
pip3 install pygame
Pygame should be a dependency of turtle. Try to download pygame with pip.

More information about the installation:

https://www.pygame.org/wiki/GettingStarted
Just link Pycharm with the python interpreter that has pygame that you installed via terminal. Pygame dependencies should be
sudo apt-get install python3-dev python-dev libsdl-image1.2-dev libsdl-mixer1.2-dev libsdl-ttf2.0-dev libsdl1.2-dev libsmpeg-dev python3-numpy python-numpy subversion libportmidi-dev libfreetype6-dev