Python Forum
ModuleNotFoundError: No module named 'pygame' - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: ModuleNotFoundError: No module named 'pygame' (/thread-21867.html)



ModuleNotFoundError: No module named 'pygame' - Cath - Oct-18-2019

(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?!?


RE: ModuleNotFoundError: No module named 'pygame' - Larz60+ - Oct-18-2019

need to install pygame:
# from command line
pip3 install pygame



RE: ModuleNotFoundError: No module named 'pygame' - LeanbridgeTech - Oct-18-2019

Pygame should be a dependency of turtle. Try to download pygame with pip.

More information about the installation:

https://www.pygame.org/wiki/GettingStarted


RE: ModuleNotFoundError: No module named 'pygame' - metulburr - Oct-18-2019

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