Skip to content

Pygame not compatible with MacOS Mojave #555

Closed

Description

@adam-hotait

Edit: pygame 2 works nicely with Mac now.

Use python3 -m pip install pygame


SDL discussion and bug report:

Homebrew issue is here: Homebrew/homebrew-core#33016


As discussed on this stackoverflow post, it seems that pygame is not compatible with MacOS Mojave, the latest version of MacOS.

Information on tests done can be found on the post. It might be a conflict with the graphical overlay managing its new Dark Mode.

Activity

  1. hevp commented on Oct 15, 2018

    @hevp

    Same issue here, running

    python -m pygame.examples.aliens

    opens a window, sounds and music can be heard, but black screen surface all the time.

  2. illume commented on Oct 16, 2018

    @illume
    Member
  3. added this to the 1.9.5 milestone on Oct 16, 2018
  4. ijean commented on Oct 21, 2018

    @ijean

    Works without a problem, on a fresh Mojave install, with Python 3.7.0 from Miniconda, the version of PyGame reported is 1.9.4 .

    screen shot 2018-10-21 at 7 06 20 am

  5. adam-hotait commented on Oct 21, 2018

    @adam-hotait
    Author

    Confirmed, it seems to work with miniconda

  6. dshrops1 commented on Nov 18, 2018

    @dshrops1

    Sorry if this is not the right place to post this, but is there a fix for this other than using miniconda? if not where can I follow to be aware when a fix is in place? I was really interested in picking up pygame but I might just go back to libGDX until this is working on Mojave!

  7. jctim commented on Nov 21, 2018

    @jctim

    The bug is reproduced with python 3.7.1 + pygame 1.9.4
    But isn't reproduced with python 3.6.5 + pygame 1.9.4

    As a work-around I created a virtualenv for 3.6.5 version

  8. MrTrustworthy commented on Nov 23, 2018

    @MrTrustworthy

    Can reproduce this using python 3.7.0, 3.6.6 and 3.6.5 with both virtualenv and venv, so downgrading python didn't seem to help.

    All Python versions mentioned above were installed via pyenv, the pygame version was always 1.9.4. Interestingly, trying it with Python 3.5.6 failed during installation of pygame with src/scrap.c:27:10: fatal error: 'SDL.h' file not found, though I don't know if that's relevant.

  9. Levilutz commented on Nov 23, 2018

    @Levilutz

    I encounter this issue with python 3.6.5 + pygame 1.9.4 and python 3.7.1 + pygame 1.9.4
    I do not encounter the issue with python 3.7.0 + pygame 1.9.4.
    Framerate increases substantially whether it works or not but running app in low resolution.
    I wonder why it would start working by switching up the 3.7.0, but then stop working again switching up to 3.7.1.

  10. reza-iranmanesh commented on Dec 17, 2018

    @reza-iranmanesh

    the miniconda suggestion didn't work for me; what i had to do was to download the pkg file from:

    https://www.python.org/downloads/release/python-370/
    for python 3.7.0
    and install

    verify:
    python3 --version
    should be 3.7.0

    then:
    pip3 install pygame (installed 1.9.4)

    then all worked.

  11. ct-chook commented on Dec 20, 2018

    @ct-chook

    Rolling back to python 3.7.0 and reinstalling pygame worked for me, but now the second problem is that display.update() became incredibly slow. The saucers in the aliens game in the examples move several times slower than before. I've timed display.update() and it seems that it takes a constant amount of time to redraw the screen regardless of how many rectangles you pass to it. Even passing a tiny 10x10 rectangle takes more than 200 ms to update.

    Edit: The solution given below fixed this problem for me.
    https://stackoverflow.com/questions/31685936/pygame-application-runs-slower-on-mac-than-on-pc

  12. nachoba commented on Dec 30, 2018

    @nachoba

    As of Python 3.7.2 the issue is unresolved.

  13. WeMadeCode commented on Jan 3, 2019

    @WeMadeCode

    As of macOS Mojave 10.14.2 and Python 3.7.2 the issue is unresolved.

  14. 47 remaining items

  15. diegolara078 commented on Dec 22, 2019

    @diegolara078

    Finally get all sorted out... thank you all!
    brew unlink python
    Unlinking /usr/local/Cellar/python/3.6.5... 25 symlinks removed
    sudo pip3 install pygame==2.0.0.dev4

  16. vikihu commented on Dec 25, 2019

    @vikihu

    macOS Mojava10.14.6+python3.8.1+pygame==2.0.0.dev6 is ok.

  17. JonFillip commented on Jan 1, 2020

    @JonFillip

    Works without a problem, on a fresh Mojave install, with Python 3.7.0 from Miniconda, the version of PyGame reported is 1.9.4 .

    screen shot 2018-10-21 at 7 06 20 am

    Hi there,

    I'm trying to get the pygame window to open but I haven't had any luck. I'm running pygame 1.9.6 with python 3.8 and macOS Mojave.
    and I guess we're both working on the alien pygame project.

  18. JonFillip commented on Jan 3, 2020

    @JonFillip

    macOS Mojava10.14.6+python3.8.1+pygame==2.0.0.dev6 is ok.

    Dude you're my hero😂

  19. luckyguy73 commented on Jan 28, 2020

    @luckyguy73

    this worked for me
    sudo pip3 install pygame==2.0.0.dev4

  20. justtomu commented on Feb 23, 2020

    @justtomu

    This worked for me:
    brew unlink python
    sudo pip3 install pygame==2.0.0.dev4

    Catalina 10.15.3

  21. vegerot commented on Feb 23, 2020

    @vegerot

    Why unlink brew’s python? Please don’t use Apple’s

  22. iuliux commented on Feb 29, 2020

    @iuliux

    Just installing 2.0.0.dev4 version of pygame and using (0, 0) for the window size did the trick for me.
    No messing with the system-wide python version needed.

  23. mehularora8 commented on Apr 1, 2020

    @mehularora8

    Installing pygame 2.0.0.dev6 fixed it for me.
    pip3 install pygame==2.0.0.dev6
    MacOS Catalina 10.15.2.

  24. tcwan commented on Apr 2, 2020

    @tcwan

    I've created a local Portfile MacPorts-py-game2.zip for MacPorts for pygame 2.0.0.dev6, with the fix to the audio mixer problem for the aliens example. pygame 2.0.0.dev4 did not work due to "sorry, extended image module required" error. This would be easiest for those on macOS Mojave who are using MacPorts version of python.

    You would need to know how to setup MacPorts to build local ports, etc.

    This has been tested for Python 3.7, I didn't try to build it for the other python versions.

  25. Udit8348 commented on Apr 10, 2020

    @Udit8348

    @mehularora8

    Installing pygame 2.0.0.dev6 fixed it for me.
    pip3 install pygame==2.0.0.dev6
    MacOS Catalina 10.15.2.

    Confirming that procedure also works for me on MacOS Catalina 10.15.4

  26. multitudes commented on Apr 13, 2020

    @multitudes

    @mehularora8

    Installing pygame 2.0.0.dev6 fixed it for me.
    pip3 install pygame==2.0.0.dev6
    MacOS Catalina 10.15.2.

    Confirming that procedure also works for me on MacOS Catalina 10.15.4

    Thanks! After a few hors of googling I made it work on Catalina 10.15.4 with the latest pygame 2.0.0.dev6

  27. dpandhi-git commented on Jul 25, 2020

    @dpandhi-git

    the miniconda suggestion didn't work for me; what i had to do was to download the pkg file from:

    https://www.python.org/downloads/release/python-370/
    for python 3.7.0
    and install

    verify:
    python3 --version
    should be 3.7.0

    then:
    pip3 install pygame (installed 1.9.4)

    then all worked.

    Thanks this work for me as well

  28. powelski commented on Sep 7, 2020

    @powelski

    Python 3.8.5 (from Homebrew)
    macOS Catalina 10.15.6
    pip3 install pygame==2.0.0.dev10

    Works like a charm 😅

    I had issues with pygame 1.9.6 - empty gray screen. Also, cmd+q and cmd+w didn't work at all. Now they do 🥂🍾

  29. rishab-rb commented on Sep 25, 2020

    @rishab-rb

    Python 3.8.5 (from Homebrew)
    macOS Catalina 10.15.6
    pip3 install pygame==2.0.0.dev10

    Works like a charm 😅

    I had issues with pygame 1.9.6 - empty gray screen. Also, cmd+q and cmd+w didn't work at all. Now they do 🥂🍾

    same versions, but not working :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions