Python Forum
pygame module not found on Idle after installing on Mac
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
pygame module not found on Idle after installing on Mac
#1
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!
Reply
#2
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
Recommended Tutorials:
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
Big Grin Error installing Pygame-Zero dpa2007 1 3,138 Dec-26-2020, 03:50 PM
Last Post: MK_CodingSpace
  installing pygame error pylab 1 4,188 Dec-31-2019, 05:44 PM
Last Post: pylab
  [PyGame] module not found? kevindadmun 2 6,746 Aug-08-2019, 11:50 PM
Last Post: kevindadmun
  [PyGame] Using joystick module from PyGame archieab 6 16,112 Sep-25-2018, 06:13 PM
Last Post: archieab
  [PyGame] Problem importing pygame / installing pygame Klar 4 9,164 Dec-16-2017, 05:48 PM
Last Post: Klar
  [pyGame] Load Image, Problem Found ! JamieVanCadsand 2 8,687 Sep-29-2017, 06:26 PM
Last Post: metulburr

Forum Jump:

User Panel Messages

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