Python Forum
ModuleNotFoundError: No module named 'pygame'
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
ModuleNotFoundError: No module named 'pygame'
#1
(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?!?
Reply
#2
need to install pygame:
# from command line
pip3 install pygame
Reply
#3
Pygame should be a dependency of turtle. Try to download pygame with pip.

More information about the installation:

https://www.pygame.org/wiki/GettingStarted
Reply
#4
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
Recommended Tutorials:
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  no module named 'docx' when importing docx MaartenRo 1 706 Dec-31-2023, 11:21 AM
Last Post: deanhystad
  Problem with pymodbus - ModuleNotFoundError: No module named 'pymodbus.client.sync' stsxbel 2 22,939 Nov-02-2023, 08:20 AM
Last Post: South_east
  ModuleNotFoundError: No module named 'requests' Serg 18 2,161 Oct-29-2023, 11:33 PM
Last Post: Serg
  Resolving ImportError: No module named gdb (Python in C++) mandaxyz 3 1,312 Oct-04-2023, 02:43 PM
Last Post: mandaxyz
  ModuleNotFoundError: No module named 'PyPDF2' Benitta2525 1 1,390 Aug-07-2023, 05:32 AM
Last Post: DPaul
  ModuleNotFoundError: No module named 'eyed3' Wimpy_Wellington 2 1,226 Jul-10-2023, 03:37 AM
Last Post: Wimpy_Wellington
  How to fix this error: ModuleNotFoundError: No module named 'notears' yaoyao22 2 961 Jul-09-2023, 11:24 AM
Last Post: yaoyao22
  Help with pyinstaller "No module named" korenron 9 8,206 Jun-15-2023, 12:20 PM
Last Post: snippsat
  Problem with Pyinstaller. No module named '_tkinter' tonynapoli2309 0 932 May-15-2023, 02:38 PM
Last Post: tonynapoli2309
  How do I get pygame module to work in Spyder? (Mac) FirstBornAlbratross 18 4,116 Dec-18-2022, 06:43 PM
Last Post: FirstBornAlbratross

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020