Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PyCharm won't import PyGame

I'm fairly new to python and decided to try PyGame only to find it won't import.

line 1, in <module>
    import pygame
ModuleNotFoundError: No module named 'pygame'

I am on windows 10, I am using PyCharm Build #PE-182.3684.126, and I pip installed it through CMD. I have reinstalled PyGame twice so far and it still won't work. If anyone can provide advice it would be greatly appreciated.

like image 307
IsaacWP121 Avatar asked Oct 16 '22 10:10

IsaacWP121


1 Answers

Open your PyCharm project. Go to File->Settings->Project->Project Interpreter. There will be a list of all installed modules on the current python environment you are using. If pygame is not listed there, it hasn't been installed for that PyCharm project (using that python environment).

Pygame environment

You can install it by using PyCharm interface, just click on the + sign and search for pygame and click install.

like image 62
Dinko Pehar Avatar answered Oct 20 '22 23:10

Dinko Pehar