0
votes

Using home-brew I have installed pygame as homebrew says this

"Requirement already satisfied: pygame in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages (1.9.1release)"

but when I run idle3 and import pygame, python says this

">>> import pygame
Traceback (most recent call last):
  File "<pyshell#1>", line 1, in <module>
    import pygame
ModuleNotFoundError: No module named 'pygame'"
2
try installing with pip instead? pip install pygame - jambrothers
thats what I did - K Olafson
In your question, you said you used homebrew. - jambrothers

2 Answers

2
votes

Add /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages to your system path so Python knows to search here for libraries.

Here's a tutorial here

0
votes

When running Idle3, you are likely not invoking your Python 2.7 interpreter for which you've installed pygame.

Does it work if you run python2.7 from the terminal and then import pygame there?