-
-
Notifications
You must be signed in to change notification settings - Fork 213
Description
Issue №2452 opened by robertpfeiffer at 2021-01-16 11:54:55
- Add detailed instructions for M1 mac to the wiki here: https://www.pygame.org/wiki/MacCompile
- find at least one contributor who has a shiny new M1 mac and is willing to test/troubleshoot the build system
- investigate up-to-dateness of SDL2 (and possibly pygame) in macports/fink/homebrew
- manually upload arm64 binary wheels for mac os 11
- better error messages when SDL2/sdl2-config is not installed/not found
- (optional) update build script for building with SDL2 Framework (instead of sdl2-config)
- maybe warn during build when an older SDL2 version is found
- investigate code paths and build flags for fast blitting on aarch64 (RPi4 and M1)
- have CI on mac OS again
related: libsdl-org/SDL#4181
Comments
# # elander99 commented at 2021-03-10 15:00:40
Is there help available for getting pygame to work on M1s as this thread implies? My friend tried installing it, but it couldn't find pygame.mixer (and some other packages), which sounds like the issues that others have had with SDL2.
# # johnson7788 commented at 2021-03-23 09:12:05
Is there help available for getting pygame to work on M1s as this thread implies? My friend tried installing it, but it couldn't find pygame.mixer (and some other packages), which sounds like the issues that others have had with SDL2.
same issue, Mac M1
/Users/admin/git/rl-flappybird/src/flappy.py:156: RuntimeWarning: use mixer: No module named 'pygame.mixer'
(ModuleNotFoundError: No module named 'pygame.mixer')
SOUNDS["die"] = pygame.mixer.Sound("data/assets/audio/die" + soundExt)
Traceback (most recent call last):
File "/Users/admin/git/rl-flappybird/src/flappy.py", line 711, in <module>
main()
File "/Users/admin/git/rl-flappybird/src/flappy.py", line 156, in main
SOUNDS["die"] = pygame.mixer.Sound("data/assets/audio/die" + soundExt)
File "/Users/admin/miniforge3/envs/py38/lib/python3.8/site-packages/pygame/__init__.py", line 59, in __getattr__
raise NotImplementedError(missing_msg)
NotImplementedError: mixer module not available (ModuleNotFoundError: No module named 'pygame.mixer')
# # devinsuttles commented at 2021-06-11 00:42:34
Any work arounds on getting pygame to work for arm chip Macs?
# # mdiazv commented at 2021-06-13 07:23:07
How can I help? :) I have a shiny M1 Mac and could spare a few hours if directed.
# # robertpfeiffer commented at 2021-06-15 19:02:21
How can I help? :) I have a shiny M1 Mac and could spare a few hours if directed.
@mdiazv You could install SDL2 via homebrew or with the binary downloads from here: https://www.libsdl.org/download-2.0.php and try compiling pygame against either one.
If you make a detailed step-by-step guide about installing SDL2 and other dependencies (like libjpeg) on a fresh install, that would help a lot. You should probably use homebrew SDL2 with homebrew python, or everything from macports analogously. Getting everything to work with Python framework and SDL2 framework would also be cool, but that requires changing the build system. We haven't worked on the mac-only code paths in a while.
As for the "if directed", well, this first task is "write a tutorial and document the pitfalls", not "follow a tutorial to the letter".
# # astraindev commented at 2021-06-16 10:57:34
I've got an M1 MacBook Air. After the fix in pull request # 2508, pygame.examples.aliens works as expected (obviously, it didn't before the fix). However, pygame.tests still does not pass 100%. In particular, the following errors are found:
(venv) mac@MacBookAir pygame % python -m pygame.tests
pygame 2.0.2.dev1 (SDL 2.0.14, Python 3.9.5)
Hello from the pygame community. https://www.pygame.org/contribute.html
skipping pygame.tests.cdrom_test (tag 'interactive')
skipping pygame.tests.overlay_test (tag 'SDL2_ignore')
skipping pygame.tests.scrap_test (tag 'SDL2_ignore')
skipping pygame.tests.sndarray_test (tag 'ignore')
skipping pygame.tests.surfarray_test (tag 'ignore')
loading pygame.tests.base_test
loading pygame.tests.blit_test
loading pygame.tests.bufferproxy_test
loading pygame.tests.camera_test
loading pygame.tests.color_test
loading pygame.tests.compat_test
loading pygame.tests.constants_test
loading pygame.tests.cursors_test
loading pygame.tests.display_test
loading pygame.tests.draw_test
loading pygame.tests.event_test
loading pygame.tests.fastevent_test
loading pygame.tests.font_test
loading pygame.tests.freetype_test
loading pygame.tests.ftfont_test
loading pygame.tests.gfxdraw_test
loading pygame.tests.image__save_gl_surface_test
loading pygame.tests.image_test
loading pygame.tests.imageext_test
loading pygame.tests.joystick_test
loading pygame.tests.key_test
loading pygame.tests.mask_test
loading pygame.tests.math_test
loading pygame.tests.midi_test
loading pygame.tests.mixer_music_test
loading pygame.tests.mixer_test
loading pygame.tests.mouse_test
loading pygame.tests.pixelarray_test
loading pygame.tests.pixelcopy_test
loading pygame.tests.rect_test
loading pygame.tests.rwobject_test
loading pygame.tests.sprite_test
loading pygame.tests.surface_test
loading pygame.tests.surflock_test
loading pygame.tests.sysfont_test
loading pygame.tests.threads_test
loading pygame.tests.time_test
loading pygame.tests.touch_test
loading pygame.tests.transform_test
loading pygame.tests.version_test
loading pygame.tests.video_test
......................................................................................................................................................s..s...............s.............................................................................................................................................................................................................................................................................................................................................s.............................................................................................................s.....s.............................................................................................................................................................xxxxxxx......x...........x........x.............................................x...x.............................................................................................................................................EEEEEEEE..s.........s..........s.s.....................................................................................................................................................................................................................................................................................................................................................................................................................................................s.s...............................................s......s......s...........................s.s......................s.s....................................s..
======================================================================
ERROR: test_MidiException (pygame.tests.midi_test.MidiModuleNonInteractiveTest)
Ensures the MidiException is raised as expected.
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/geek/src/pygame/venv/lib/python3.9/site-packages/pygame/tests/midi_test.py", line 344, in setUp
import pygame.midi
File "/Users/geek/src/pygame/venv/lib/python3.9/site-packages/pygame/midi.py", line 35, in <module>
import pygame.pypm as _pypm
ModuleNotFoundError: No module named 'pygame.pypm'
======================================================================
ERROR: test_conversions (pygame.tests.midi_test.MidiModuleNonInteractiveTest)
of frequencies to midi note numbers and ansi note names.
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/geek/src/pygame/venv/lib/python3.9/site-packages/pygame/tests/midi_test.py", line 344, in setUp
import pygame.midi
File "/Users/geek/src/pygame/venv/lib/python3.9/site-packages/pygame/midi.py", line 35, in <module>
import pygame.pypm as _pypm
ModuleNotFoundError: No module named 'pygame.pypm'
======================================================================
ERROR: test_midiin (pygame.tests.midi_test.MidiModuleNonInteractiveTest)
Ensures the MIDIIN event id exists in the midi module.
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/geek/src/pygame/venv/lib/python3.9/site-packages/pygame/tests/midi_test.py", line 344, in setUp
import pygame.midi
File "/Users/geek/src/pygame/venv/lib/python3.9/site-packages/pygame/midi.py", line 35, in <module>
import pygame.pypm as _pypm
ModuleNotFoundError: No module named 'pygame.pypm'
======================================================================
ERROR: test_midiout (pygame.tests.midi_test.MidiModuleNonInteractiveTest)
Ensures the MIDIOUT event id exists in the midi module.
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/geek/src/pygame/venv/lib/python3.9/site-packages/pygame/tests/midi_test.py", line 344, in setUp
import pygame.midi
File "/Users/geek/src/pygame/venv/lib/python3.9/site-packages/pygame/midi.py", line 35, in <module>
import pygame.pypm as _pypm
ModuleNotFoundError: No module named 'pygame.pypm'
======================================================================
ERROR: test_midis2events (pygame.tests.midi_test.MidiModuleNonInteractiveTest)
Ensures midi events are properly converted to pygame events.
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/geek/src/pygame/venv/lib/python3.9/site-packages/pygame/tests/midi_test.py", line 344, in setUp
import pygame.midi
File "/Users/geek/src/pygame/venv/lib/python3.9/site-packages/pygame/midi.py", line 35, in <module>
import pygame.pypm as _pypm
ModuleNotFoundError: No module named 'pygame.pypm'
======================================================================
ERROR: test_midis2events__extra_event_data (pygame.tests.midi_test.MidiModuleNonInteractiveTest)
Ensures midi events with extra values are handled properly.
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/geek/src/pygame/venv/lib/python3.9/site-packages/pygame/tests/midi_test.py", line 344, in setUp
import pygame.midi
File "/Users/geek/src/pygame/venv/lib/python3.9/site-packages/pygame/midi.py", line 35, in <module>
import pygame.pypm as _pypm
ModuleNotFoundError: No module named 'pygame.pypm'
======================================================================
ERROR: test_midis2events__extra_event_data_missing_timestamp (pygame.tests.midi_test.MidiModuleNonInteractiveTest)
Ensures midi events with extra data and no timestamps are handled
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/geek/src/pygame/venv/lib/python3.9/site-packages/pygame/tests/midi_test.py", line 344, in setUp
import pygame.midi
File "/Users/geek/src/pygame/venv/lib/python3.9/site-packages/pygame/midi.py", line 35, in <module>
import pygame.pypm as _pypm
ModuleNotFoundError: No module named 'pygame.pypm'
======================================================================
ERROR: test_midis2events__missing_event_data (pygame.tests.midi_test.MidiModuleNonInteractiveTest)
Ensures midi events with missing values are handled properly.
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/geek/src/pygame/venv/lib/python3.9/site-packages/pygame/tests/midi_test.py", line 344, in setUp
import pygame.midi
File "/Users/geek/src/pygame/venv/lib/python3.9/site-packages/pygame/midi.py", line 35, in <module>
import pygame.pypm as _pypm
ModuleNotFoundError: No module named 'pygame.pypm'
----------------------------------------------------------------------
Ran 1633 tests in 38.378s
FAILED (errors=8)
(venv) mac@MacBookAir pygame %
# # astraindev commented at 2021-06-16 13:47:46
- Add detailed instructions for M1 mac to the wiki here: https://www.pygame.org/wiki/MacCompile
I'm willing to do this but it says that registration is disabled. Please advise.
# # astraindev commented at 2021-06-17 04:39:50
From a clean slate (empty Homebrew): Run the following commands and it works:
brew update
brew install python@3.9
brew install pkg-config xquartz
brew install sdl2 sdl2_gfx sdl2_image sdl2_mixer sdl2_net sdl2_ttf
python3 -m venv pygame2
source ./pygame2/bin/activate
pip install --upgrade pip setuptools
pip install wheel
pip install venvdotapp
venvdotapp
pip install --no-cache-dir git+https://github.com/nelsonlove/pygame
Of course, that last line needs to be changed....but that's how I got it to work for now. Again, that git URL is from pull request # 2508.
# # mdiazv commented at 2021-06-17 06:37:56
I confirm the above steps by @andrewdstrain work on my M1 Mac too!
# # robertpfeiffer commented at 2021-06-17 10:29:50
thanks, @andrewdstrain. I'll edit the wiki later today and link to this issue.
Can you clone/checkout https://github.com/nelsonlove/pygame and tell me if python3 setup.py config -auto finds optional dependencies like libjpeg and portmidi? Do they also have to be installed via homebrew?
That PR probably needs to be rebased and refactored.
Last time I looked into getting this to work with the SDL2 framework and Python framework, I gave up because this would actually require code changes, and it was x86-only anyway. We may want a different file from config_darwin.py for M1 mac buildconfig and just require SDL2 or higher. Maybe we could call it config_macos11_arm.py
# # astraindev commented at 2021-06-18 11:24:02
Yes, I'll do that. If it helps, below, are the versions of SDL2 that Homebrew is using:
As for libjpeg and portmidi, using the steps, above, does not incorporate them. But I'll check doing it the other way, above. I can do a comparison of the two ways and see if anything is added. I know I've already tried portmidi (due to the error in pygame.tests and, using the above method, didn't add it. But I'm going to do it exactly as you said.
sdl2 2.0.14_1
sdl2_gfx 1.0.4
sdl2_image 2.0.5
sdl2_mixer 2.0.4_1
sdl2_net 2.0.1
sdl2_ttf. 2.0.15
# # astraindev commented at 2021-06-18 12:06:27
Here's the output of python3 setup.py config -auto:
Using Darwin configuration...
Hunting dependencies...
SDL : found 2.0.14
FONT : found
IMAGE : found
MIXER : found
Framework CoreMIDI not found
Framework QuickTime not found
PNG : found
JPEG : found
PORTMIDI: found
FREETYPE: found 23.4.17
If you get compiler errors during install, double-check
the compiler flags in the "Setup" file.
Continuing With "setup.py"
running config
Okay - so it seems that portmidi (libjpeg is already installed) needs to be added to my steps, above. However, an install did not fix pygame.tests. I also installed pyobjc-framework-CoreMIDI with no luck finding CoreMIDI.
The exact error that pygame.tests gives has to do with pygame.pypm not being found. So maybe, on an M1, portmidi (which is pygame.pypm, I think [I could be wrong] - the error in pygame.tests) needs to be created differently to get the pymd module working. Or just remove it altogether.
# # astraindev commented at 2021-06-19 04:57:46
I finally figured out how to fix pygame.tests to work 100%. The reason it was failing is because the Setup file has the pypm module commented out but it was being tested for anyway. Here's how to get it to work, from the beginning:
brew update
brew install python@3.9
brew install pkg-config xquartz portmidi
brew install sdl2 sdl2_gfx sdl2_image sdl2_mixer sdl2_net sdl2_ttf
python3 -m venv pygame2
source ./pygame2/bin/activate
pip install --upgrade pip setuptools
pip install wheel
pip install venvdotapp
venvdotapp
git clone https://github.com/nelsonlove/pygame
cd pygame
python setup.py config -auto
From here, we need to edit the Setup file. In particular change
PORTTIME = -lC -lo -lr -le -lM -lI -lD -lI
to
PORTTIME = -lC -lM
and change
# pypm src_c/pypm.c $(SDL) $(PORTMIDI) $(PORTTIME) $(DEBUG)
to
pypm src_c/pypm.c $(SDL) $(PORTMIDI) $(PORTTIME) $(DEBUG)
Save the Setup file and, finally:
python setup.py install
python -m pygame.tests
And it will pass 100% of the tests.
Ideally, for those that don't want pypm, the default, the tests should not test for it and it will pass 100%. And, of course, test for it if it is enabled. But that's probably more work than is needed.
Regardless, the PORTTIME line is wrong.
Finally, this may need to be done for the Intel Macs to pass the tests 100%. Unfortunately, I cannot check to see if that is the case.
Note: In Homebrew, portmidi only needs to be installed if pypm is enabled. Otherwise, the Homebrew package portmidi is never used in the codebase.
Also, on Linux, pypm is enabled by default.
# # astraindev commented at 2021-06-19 06:35:14
I discovered that having XQuartz installed increases performance. The pygame.tests are about 20 seconds faster just with it installed. You don't even have to use it.
Note: XQuartz is a Universal binary. Everything I've been doing is arm64 or Universal. No Intel-only at all.
# # gramss commented at 2021-08-28 03:05:20
@andrewdstrain , I followed your exact steps, but I only get pixel "rubbish" out of the tests. As I have never sawn any tests successfully before I cannot confirm if they are intended that way..
But I would say not.
Could you verify that everything still works on your end?
Here is a picture I took from a test, to give some ideas about it:

They appear in saller and bigger ways. Here are the failures I got from the tests:
......................................................................................................................................................s..s...............s..............................................................................................................................................................................................................................................F................F.............................................................................s.............................................................................................................s.....s........F....................................................................................................................................................xxxxxxx......x...........x........x.............................................x...x.......................................................................................................................................................s.........s..........s.s.....................................................................................................................................................................................................................................................................................................................................................................................................................................................s.s...............................................s......s......s...........................s.s......................s.s....................................s..
FAIL: test_get_grab (pygame.tests.event_test.EventModuleTest)
Ensure get_grab() works as expected
Traceback (most recent call last):
File "............./pygame2/lib/python3.9/site-packages/pygame-2.0.2.dev1-py3.9-macosx-11-arm64.egg/pygame/tests/event_test.py", line 776, in test_get_grab
self.assertEqual(pygame.event.get_grab(), i % 2)
AssertionError: 0 != 1
======================================================================
FAIL: test_set_grab__and_get_symmetric (pygame.tests.event_test.EventModuleTest)
Ensure event grabbing can be enabled and disabled.
Traceback (most recent call last):
File "............./pygame2/lib/python3.9/site-packages/pygame-2.0.2.dev1-py3.9-macosx-11-arm64.egg/pygame/tests/event_test.py", line 697, in test_set_grab__and_get_symmetric
self.assertTrue(pygame.event.get_grab())
AssertionError: 0 is not true
======================================================================
FAIL: test_get_focused (pygame.tests.key_test.KeyModuleTest)
Traceback (most recent call last):
File "............./pygame2/lib/python3.9/site-packages/pygame-2.0.2.dev1-py3.9-macosx-11-arm64.egg/pygame/tests/key_test.py", line 49, in test_get_focused
self.assertTrue(focused)
AssertionError: 0 is not true
Ran 1633 tests in 57.896s
FAILED (failures=3)
I hope it helps.. :) Still thank you for your effort!
Thanks to the line with the tests I know that I have an issue with pygame and not the application I wanna run. At least something.. 👍
And yes, I run the exact same steps as you above.
# # pkulev commented at 2021-09-24 11:22:51
Guys, when release with M1 support will be available in PyPI? It's quite inconvinient to build all of this by hands...
# # leftbones commented at 2021-10-18 17:02:18
Guys, when release with M1 support will be available in PyPI? It's quite inconvinient to build all of this by hands...
I'm also wondering this. Please give us a release!
# # ankith26 commented at 2021-10-20 05:35:41
Hopefully we can get this issue sorted by the next release, and have arm64/universal2 wheels on PyPI
# # ankith26 commented at 2021-10-27 14:21:41
2782 is a start on this issue, to fix some of the points mentioned here
# # illume commented at 2021-10-31 13:08:10
Anyone with an M1 able to test if the pre-release works for them on M1?
python3 -m pip install pygame==2.0.3.dev6
# # solozobov commented at 2021-10-31 13:20:11
For me it worked. Thank You!!!

# # illume commented at 2021-10-31 13:42:50
Thanks @solozobov
I wonder if it runs ok?
# run an example game
python3 -m pygame.examples.aliens
# run the full test suite. (save your work first, takes a couple of minutes, goes fullscreen and back, makes noises)
python3 -m pygame.tests
# # pkulev commented at 2021-10-31 13:51:34
8 tests failed, other passed.
======================================================================
ERROR: test_MidiException (pygame.tests.midi_test.MidiModuleNonInteractiveTest)
Ensures the MidiException is raised as expected.
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/most/proj/astrolero/.venv/lib/python3.9/site-packages/pygame/tests/midi_test.py", line 344, in setUp
import pygame.midi
File "/Users/most/proj/astrolero/.venv/lib/python3.9/site-packages/pygame/midi.py", line 35, in <module>
import pygame.pypm as _pypm
ImportError: dlopen(/Users/most/proj/astrolero/.venv/lib/python3.9/site-packages/pygame/pypm.cpython-39-darwin.so, 2): Symbol not found: _Pt_Time
Referenced from: /Users/most/proj/astrolero/.venv/lib/python3.9/site-packages/pygame/pypm.cpython-39-darwin.so
Expected in: flat namespace
in /Users/most/proj/astrolero/.venv/lib/python3.9/site-packages/pygame/pypm.cpython-39-darwin.so
======================================================================
ERROR: test_conversions (pygame.tests.midi_test.MidiModuleNonInteractiveTest)
of frequencies to midi note numbers and ansi note names.
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/most/proj/astrolero/.venv/lib/python3.9/site-packages/pygame/tests/midi_test.py", line 344, in setUp
import pygame.midi
File "/Users/most/proj/astrolero/.venv/lib/python3.9/site-packages/pygame/midi.py", line 35, in <module>
import pygame.pypm as _pypm
ImportError: dlopen(/Users/most/proj/astrolero/.venv/lib/python3.9/site-packages/pygame/pypm.cpython-39-darwin.so, 2): Symbol not found: _Pt_Time
Referenced from: /Users/most/proj/astrolero/.venv/lib/python3.9/site-packages/pygame/pypm.cpython-39-darwin.so
Expected in: flat namespace
in /Users/most/proj/astrolero/.venv/lib/python3.9/site-packages/pygame/pypm.cpython-39-darwin.so
======================================================================
ERROR: test_midiin (pygame.tests.midi_test.MidiModuleNonInteractiveTest)
Ensures the MIDIIN event id exists in the midi module.
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/most/proj/astrolero/.venv/lib/python3.9/site-packages/pygame/tests/midi_test.py", line 344, in setUp
import pygame.midi
File "/Users/most/proj/astrolero/.venv/lib/python3.9/site-packages/pygame/midi.py", line 35, in <module>
import pygame.pypm as _pypm
ImportError: dlopen(/Users/most/proj/astrolero/.venv/lib/python3.9/site-packages/pygame/pypm.cpython-39-darwin.so, 2): Symbol not found: _Pt_Time
Referenced from: /Users/most/proj/astrolero/.venv/lib/python3.9/site-packages/pygame/pypm.cpython-39-darwin.so
Expected in: flat namespace
in /Users/most/proj/astrolero/.venv/lib/python3.9/site-packages/pygame/pypm.cpython-39-darwin.so
======================================================================
ERROR: test_midiout (pygame.tests.midi_test.MidiModuleNonInteractiveTest)
Ensures the MIDIOUT event id exists in the midi module.
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/most/proj/astrolero/.venv/lib/python3.9/site-packages/pygame/tests/midi_test.py", line 344, in setUp
import pygame.midi
File "/Users/most/proj/astrolero/.venv/lib/python3.9/site-packages/pygame/midi.py", line 35, in <module>
import pygame.pypm as _pypm
ImportError: dlopen(/Users/most/proj/astrolero/.venv/lib/python3.9/site-packages/pygame/pypm.cpython-39-darwin.so, 2): Symbol not found: _Pt_Time
Referenced from: /Users/most/proj/astrolero/.venv/lib/python3.9/site-packages/pygame/pypm.cpython-39-darwin.so
Expected in: flat namespace
in /Users/most/proj/astrolero/.venv/lib/python3.9/site-packages/pygame/pypm.cpython-39-darwin.so
======================================================================
ERROR: test_midis2events (pygame.tests.midi_test.MidiModuleNonInteractiveTest)
Ensures midi events are properly converted to pygame events.
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/most/proj/astrolero/.venv/lib/python3.9/site-packages/pygame/tests/midi_test.py", line 344, in setUp
import pygame.midi
File "/Users/most/proj/astrolero/.venv/lib/python3.9/site-packages/pygame/midi.py", line 35, in <module>
import pygame.pypm as _pypm
ImportError: dlopen(/Users/most/proj/astrolero/.venv/lib/python3.9/site-packages/pygame/pypm.cpython-39-darwin.so, 2): Symbol not found: _Pt_Time
Referenced from: /Users/most/proj/astrolero/.venv/lib/python3.9/site-packages/pygame/pypm.cpython-39-darwin.so
Expected in: flat namespace
in /Users/most/proj/astrolero/.venv/lib/python3.9/site-packages/pygame/pypm.cpython-39-darwin.so
======================================================================
ERROR: test_midis2events__extra_event_data (pygame.tests.midi_test.MidiModuleNonInteractiveTest)
Ensures midi events with extra values are handled properly.
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/most/proj/astrolero/.venv/lib/python3.9/site-packages/pygame/tests/midi_test.py", line 344, in setUp
import pygame.midi
File "/Users/most/proj/astrolero/.venv/lib/python3.9/site-packages/pygame/midi.py", line 35, in <module>
import pygame.pypm as _pypm
ImportError: dlopen(/Users/most/proj/astrolero/.venv/lib/python3.9/site-packages/pygame/pypm.cpython-39-darwin.so, 2): Symbol not found: _Pt_Time
Referenced from: /Users/most/proj/astrolero/.venv/lib/python3.9/site-packages/pygame/pypm.cpython-39-darwin.so
Expected in: flat namespace
in /Users/most/proj/astrolero/.venv/lib/python3.9/site-packages/pygame/pypm.cpython-39-darwin.so
======================================================================
ERROR: test_midis2events__extra_event_data_missing_timestamp (pygame.tests.midi_test.MidiModuleNonInteractiveTest)
Ensures midi events with extra data and no timestamps are handled
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/most/proj/astrolero/.venv/lib/python3.9/site-packages/pygame/tests/midi_test.py", line 344, in setUp
import pygame.midi
File "/Users/most/proj/astrolero/.venv/lib/python3.9/site-packages/pygame/midi.py", line 35, in <module>
import pygame.pypm as _pypm
ImportError: dlopen(/Users/most/proj/astrolero/.venv/lib/python3.9/site-packages/pygame/pypm.cpython-39-darwin.so, 2): Symbol not found: _Pt_Time
Referenced from: /Users/most/proj/astrolero/.venv/lib/python3.9/site-packages/pygame/pypm.cpython-39-darwin.so
Expected in: flat namespace
in /Users/most/proj/astrolero/.venv/lib/python3.9/site-packages/pygame/pypm.cpython-39-darwin.so
======================================================================
ERROR: test_midis2events__missing_event_data (pygame.tests.midi_test.MidiModuleNonInteractiveTest)
Ensures midi events with missing values are handled properly.
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/most/proj/astrolero/.venv/lib/python3.9/site-packages/pygame/tests/midi_test.py", line 344, in setUp
import pygame.midi
File "/Users/most/proj/astrolero/.venv/lib/python3.9/site-packages/pygame/midi.py", line 35, in <module>
import pygame.pypm as _pypm
ImportError: dlopen(/Users/most/proj/astrolero/.venv/lib/python3.9/site-packages/pygame/pypm.cpython-39-darwin.so, 2): Symbol not found: _Pt_Time
Referenced from: /Users/most/proj/astrolero/.venv/lib/python3.9/site-packages/pygame/pypm.cpython-39-darwin.so
Expected in: flat namespace
in /Users/most/proj/astrolero/.venv/lib/python3.9/site-packages/pygame/pypm.cpython-39-darwin.so
----------------------------------------------------------------------
Ran 1678 tests in 50.941s
FAILED (errors=8)
# # ankith26 commented at 2021-10-31 14:00:13
Thanks for testing and reporting the issue! So pygame.midi is having some problems here on M1 mac chips! I will look into this now. Also in the meantime if you find any other issues while running pygame examples and such, do report it :)
# # pkulev commented at 2021-10-31 14:43:03
I've tested all the examples.
- As expected, midi example doesn't work with the same 'symbol not found' error.
- music_drop_fade looks a little weird:
- scrap_clipboard acts weird too:
Putting image into the clipboard.
Traceback (most recent call last):
File "/opt/homebrew/Cellar/python@3.9/3.9.7_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/opt/homebrew/Cellar/python@3.9/3.9.7_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/Users/most/proj/astrolero/.venv/lib/python3.9/site-packages/pygame/examples/scrap_clipboard.py", line 88, in <module>
scrap.put("image/bmp", buf)
pygame.error: content could not be placed in clipboard.
Placing clipboard text.
Traceback (most recent call last):
File "/opt/homebrew/Cellar/python@3.9/3.9.7_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/opt/homebrew/Cellar/python@3.9/3.9.7_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/Users/most/proj/astrolero/.venv/lib/python3.9/site-packages/pygame/examples/scrap_clipboard.py", line 72, in <module>
scrap.put(pg.SCRAP_TEXT, as_bytes("Hello. This is a message from scrap."))
pygame.error: content could not be placed in clipboard.
# # ankith26 commented at 2021-10-31 15:02:51
I opened # 2808 to fix the midi issue on M1 macs.
About the screen having noise, It is likely related to the SDL issue that happens on macs, where surfaces are not filled with black colour on creation. And scrap is partly broken on mac anyways, it was never considered "stable".
These issues should be fixed at some point, but are not blockers for the upcoming release :)
# # ankith26 commented at 2021-11-16 10:47:57
Now pygame works fine on apple silicon, so this issue can be closed. Yet there are some tasks in the original comment that are nice to have, and are not M1 specific so they should be in their own issue to be addressed
better error messages when SDL2/sdl2-config is not installed/not found
(optional) update build script for building with SDL2 Framework (instead of sdl2-config)
maybe warn during build when an older SDL2 version is found

