Problem when launching PyBoy with a python script on macOS M1
Sotramp opened this issue · 4 comments
Hello,
I just installed PyBoy on macOS with the M1 chip. It works perfectly well from the terminal, but when I try to launch the emulator from a python script (with the code in the documentation), I get these warnings :
UserWarning: Using SDL2 binaries from pysdl2-dll 2.0.16 objc[73603]: Class METAL_RenderData is implemented in both /opt/homebrew/opt/sdl2/lib/libSDL2-2.0.0.dylib (0x104b849c0) and /Users/sotramp/Library/Python/3.8/lib/python/site-packages/sdl2dll/dll/SDL2.framework/Versions/A/SDL2 (0x10b1f80f0). One of the two will be used. Which one is undefined. [ ...... ] /Users/sotramp/Library/Python/3.8/lib/python/site-packages/sdl2/dll.py:182: DLLWarning: OSError('dlopen(/Users/sotramp/Library/Python/3.8/lib/python/site-packages/sdl2dll/dll/SDL2_ttf.framework/Versions/A/SDL2_ttf, 6): no suitable image found. Did find:\n\t/Users/sotramp/Library/Python/3.8/lib/python/site-packages/sdl2dll/dll/SDL2_ttf.framework/Versions/A/SDL2_ttf: mach-o, but wrong architecture\n\t/Users/sotramp/Library/Python/3.8/lib/python/site-packages/sdl2dll/dll/SDL2_ttf.framework/Versions/A/SDL2_ttf: mach-o, but wrong architecture') warnings.warn(repr(exc), DLLWarning) /Users/sotramp/Library/Python/3.8/lib/python/site-packages/sdl2/dll.py:182: DLLWarning: OSError('dlopen(/Users/sotramp/Library/Python/3.8/lib/python/site-packages/sdl2dll/dll/SDL2_image.framework/Versions/A/SDL2_image, 6): no suitable image found. Did find:\n\t/Users/sotramp/Library/Python/3.8/lib/python/site-packages/sdl2dll/dll/SDL2_image.framework/Versions/A/SDL2_image: mach-o, but wrong architecture\n\t/Users/sotramp/Library/Python/3.8/lib/python/site-packages/sdl2dll/dll/SDL2_image.framework/Versions/A/SDL2_image: mach-o, but wrong architecture') warnings.warn(repr(exc), DLLWarning)
If anyone has any idea what the problem is. I have looked at several forums and normally SDL2 is compatible with the Apple ARM chip.
I sadly don't have an M1 Mac, so I can't be of much help. But I assume you have the correct SDL2 binaries installed through Brew (/opt/homebrew/opt/sdl2/
), but then there is a Python package (/Users/sotramp/Library/Python/3.8/lib/python/site-packages/sdl2dll/
) which installed the x86_64 version of the SDL2 binaries as well.
You should probably investigate where you got the sdl2dll
package from, and if you should remove it.
You might have more luck asking here: https://github.com/a-hurst/pysdl2-dll
I'll close this, as it doesn't seem to be an issue with PyBoy, but with the pysdl2-dll package. If you believe this is incorrect, I'll reopen this issue.
Yes, the author of pysdl2-dll
gave me a temporary solution that works. For those interested, it's here: a-hurst/pysdl2-dll#7
Thank you for your help.