New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pygame not compatible with MacOS Mojave #555

Open
adam-hotait opened this Issue Oct 10, 2018 · 27 comments

Comments

Projects
None yet
@adam-hotait
Copy link

adam-hotait commented Oct 10, 2018

UPDATE FIX: If you download the official macOS x64 installer package of Python 3.7.2 from the official python page and then pip3 install pygame it works.

  • homebrew python 3.7 still has a problem.

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.

@hevp

This comment has been minimized.

Copy link

hevp commented Oct 15, 2018

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.

@illume

This comment has been minimized.

@illume illume added the 1.9.5 label Oct 16, 2018

@illume illume added this to the 1.9.5 milestone Oct 16, 2018

@illume illume referenced this issue Oct 16, 2018

Open

pygame 1.9.5 release #495

1 of 35 tasks complete
@ijean

This comment has been minimized.

Copy link

ijean commented Oct 21, 2018

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

@adam-hotait

This comment has been minimized.

Copy link
Author

adam-hotait commented Oct 21, 2018

Confirmed, it seems to work with miniconda

setminami added a commit to setminami/SunlightControl that referenced this issue Oct 30, 2018

@dshrops1

This comment has been minimized.

Copy link

dshrops1 commented Nov 18, 2018

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!

@jctim

This comment has been minimized.

Copy link

jctim commented Nov 21, 2018

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

@MrTrustworthy

This comment has been minimized.

Copy link

MrTrustworthy commented Nov 23, 2018

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.

@Levilutz

This comment has been minimized.

Copy link

Levilutz commented Nov 23, 2018

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.

@reza-iranmanesh

This comment has been minimized.

Copy link

reza-iranmanesh commented Dec 17, 2018

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.

@ct-chook

This comment has been minimized.

Copy link

ct-chook commented Dec 20, 2018

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

@nachoba

This comment has been minimized.

Copy link

nachoba commented Dec 30, 2018

As of Python 3.7.2 the issue is unresolved.

@WeMadeCode

This comment has been minimized.

Copy link

WeMadeCode commented Jan 3, 2019

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

@lupinthird

This comment has been minimized.

Copy link

lupinthird commented Jan 8, 2019

I followed the advice up above and downloaded the official macOS x64 installer package of Python 3.7.2 from the official python page, and then used:

pip3 install pygame

And now I'm seeing the window contents again. (macOS 10.14.1, going to update to 10.14.2 and verify all else is fine).

@DanielJenkyn

This comment has been minimized.

Copy link

DanielJenkyn commented Jan 10, 2019

Looking at the Pygame 1.9.5 milestone...it states you are waiting for an SDL fix but it looks like this was fixed back SDL 2.0.8 (Current SDL 2.0.9) - https://bugzilla.libsdl.org/show_bug.cgi?id=4272

Im guessing that you are waiting for the 1.2.x historic version of SDL to be patched though?

@illume

This comment has been minimized.

Copy link
Member

illume commented Jan 11, 2019

@DanielJenkyn

If you download the official macOS x64 installer package of Python 3.7.2 from the official python page and then pip3 install pygame it works.

2 is using SDL2, 1.9.5 will use SDL1.

@DanielJenkyn

This comment has been minimized.

Copy link

DanielJenkyn commented Jan 12, 2019

@illume Just to point out, using python 3.7.2 and pip3 pygame works great...However the Homebrew version of python 3.7.2 results in the blank game window using the same version of pygame

@illume

This comment has been minimized.

Copy link
Member

illume commented Jan 14, 2019

Thanks @DanielJenkyn I updated the issue. I'm going to upgrade my mac in the coming days, so will be able to look into it then.

@idchlife

This comment has been minimized.

Copy link

idchlife commented Jan 15, 2019

As I understand, due to closed state of homebrew issue, they are not going to fix it, yes?

So the solution is to remove homebrew python3.7.2 and use official installer from python website?

@ChaseHardin

This comment has been minimized.

Copy link

ChaseHardin commented Jan 19, 2019

My operating system is macOS Mojave and I am experiencing the same thing. I've configured my development environment using Pyenv 1.2.9. On Pyenv, I've install Python 3.7.2 and Pygame 1.9.4. Python was installed using Pyenv and Pygame was installed using pip.

When running my code snippet, I get this screen:

screen shot 2019-01-18 at 8 16 10 pm

This error also occurs when running the Pygame example, python3 -m pygame.examples.aliens.

When can we expect Pygame to be compatible with Mojave?

NOTE: I've tried Python 3.7.2, 3.7.0, 3.6.5, and 3.6.1.

@idchlife

This comment has been minimized.

Copy link

idchlife commented Jan 20, 2019

@ChaseHardin I suspect installing 3.7.2 via official .dmg installer from python.org will do the trick. Did not try it myself, though, yet

@markph0204

This comment has been minimized.

Copy link
Contributor

markph0204 commented Jan 21, 2019

@ChaseHardin Can you try pulling the latest from source/github? While I've been testing the 1.9.4 build has never worked on MacOS (other than Mojave) for me, BUT when I build -- even 1.9.4 from source, I have no issue.

This top section of the page -- are updates that I made -- and should work for you.
https://www.pygame.org/wiki/MacCompile

@ChaseHardin

This comment has been minimized.

Copy link

ChaseHardin commented Jan 23, 2019

@idchlife I'd like to continue using Pyenv so that I can have my own virtual environment. Any recommendations if I use Pyenv?

@markph0204 how would I pull the latest from source/github? I installed Pygame using the pip3 installer. Also to note, I'm using MacOS Mojave.

I'm seeing a lot of reference to mercurial. Is that something Python/Pygame needs to run?

@markph0204

This comment has been minimized.

Copy link
Contributor

markph0204 commented Jan 23, 2019

@ChaseHardin You do not need mercurial -- you need git and it comes installed on MacOS by default. To get the latest from pygame, you can git clone https://github.com/pygame/pygame.git then build it local or follow Step 5 on the page I shared: https://www.pygame.org/wiki/MacCompile

Also you can use pyenv -- just activate the environment you want before you pip install.

Good luck!

@marcinlesek

This comment has been minimized.

Copy link

marcinlesek commented Jan 23, 2019

Unfortunately, reproduced on MacOS Mojave 10.14.2, with pyenv pythons versions: 3.7.2, 3.7.0, 3.6.8 and 3.6.5 for pygame 1.9.4 installed from pipenv. 😕

I don't want to compiling sources, installing additional pythons which could a bit make mess on my Mac or so, it should be normally available with base python interpreter.

Hope to get it fixed and released soon, now need to change computer for my Linux. 🐧

@kronicle114

This comment has been minimized.

Copy link

kronicle114 commented Feb 5, 2019

@reza-iranmanesh 's instructions worked for me:

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)

Downloading the macOS x64 installer package of Python 3.7.0 from the official python page and then pip3 install pygame. I'm using macOS Mojave 10.14.2. I just have to use the command python3 file_url to initiate.

@samuelhwilliams

This comment has been minimized.

Copy link

samuelhwilliams commented Feb 6, 2019

I'm having the same issue with pygame==1.9.4, Python==3.7.2 and macOS==10.14.2. Will look into building from source.

@pontusmelke

This comment has been minimized.

Copy link

pontusmelke commented Feb 6, 2019

I had the same issue, got it to work by downgrading python to 3.6.5.

brew unlink python 
brew install --ignore-dependencies https://raw.githubusercontent.com/Homebrew/homebrew-core/f2a764ef944b1080be64bd88dca9a1d80130c558/Formula/python.rb
brew switch python 3.6.5_1
pip3 install pygame

If you already have python 3.6.5 install I guess you can just use switch.

@kylecorry31 kylecorry31 referenced this issue Feb 9, 2019

Closed

Add gui #4

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