Python Forum
pygame module not found on Idle after installing on Mac - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: Game Development (https://python-forum.io/forum-11.html)
+--- Thread: pygame module not found on Idle after installing on Mac (/thread-26670.html)



pygame module not found on Idle after installing on Mac - crunchypen - May-09-2020

Hi
Iam a beginner and
I am trying to install pygame on Mac OS. I tried a lot of times using a lot of stuff. To name a few:

python3 -m pip install -U pygame --user

python3 -m pygame.examples.aliens

The above one worked fine. But when I try to import pygame on Idle

Python 3.8.2 (v3.8.2:7b3ab5921f, Feb 24 2020, 17:52:18)
[Clang 6.0 (clang-600.0.57)] on darwin
Type "help", "copyright", "credits" or "license()" for more information.
>>> import pygame
Traceback (most recent call last):
File "<pyshell#0>", line 1, in <module>
import pygame
ModuleNotFoundError: No module named 'pygame'
>>>

Then I tried
pip3 install hg+http://bitbucket.org/pygame/pygame

Here it was giving me some finding wheel error.

when I try this pip3 install pygame

it says:
Requirement already satisfied: pygame in ./Library/Python/3.7/lib/python/site-packages (2.0.0.dev6)

and I dont see any pygame folder in the above mentioned site-packages.

I am totally confused. Please help. I want to do code some games with pygame!!

Thanks in advance!


RE: pygame module not found on Idle after installing on Mac - metulburr - May-09-2020

The Python version you install pygame to and the python version you are running to test it are two different python versions with independent 3rd party libraries (one of which has pygame installed and the other does not)
Quote: Python 3.8.2 (v3.8.2:7b3ab5921f, Feb 24 2020, 17:52:18)
Quote: Requirement already satisfied: pygame in ./Library/Python/3.7/lib/python/site-packages (2.0.0.dev6)
Based on this you installed it to a different python version. This is Python3.7, not Python3.8.2


(May-09-2020, 05:15 AM)crunchypen Wrote: But when I try to import pygame on Idle
You can make any IDE use any python version. Just point it to the one you installed pygame to. or invoke the python interpreter that your IDLE is running to install pygame