0

I installed pygame through the terminal using pip on my macOS.

Inside Pycharm, the preferences for the project interpreter include pygame for Python 3.7 as seen in this screenshot: https://i.stack.imgur.com/TRuot.png

However, when I type import pygame it marks it as an error and states

module not found

The project is using the same interpreter (python 3.7) where it is installed.

I have tried uninstalling and reinstalling pygame but have found no luck.

I've been searching around Youtube for a couple days and can't find any solution. Thanks in advance for any help!

Yasen
  • 4,241
  • 1
  • 16
  • 25
Thomas Huitema
  • 133
  • 1
  • 9

1 Answers1

0

Did you install using pip or pip3? I don't know if it's different for my OS (linux), but if I use pip, it only installs for python2.

  • I installed using pip, not pip3. It still shows that it is installed in the Python 3.7 interpreter inside Pycharm, though. Should I try installing it through pip3? – Thomas Huitema Mar 11 '20 at 11:39
  • Yes, try that. My guess is that the environment paths aren't being set up. pip3 install (name). If that doesn't work, my only other guess is to double check that you're importing the module by the correct name (should be in the pycharm docs). – downwithocp Mar 11 '20 at 15:25
  • Sorry, I meant in the pygame docs. I'd forgotten that pycharm is an IDE. I've also found this similar question, so if those don't work, maybe your answer is in here: https://stackoverflow.com/questions/19885821/how-do-i-import-modules-in-pycharm – downwithocp Mar 11 '20 at 22:39