-
Notifications
You must be signed in to change notification settings - Fork 49
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
macOS - pysdl2-dll is installed as source-only #278
Comments
Hi @C0rn3j! Have never tried using pysdl2-dll with pyinstaller before, but if it doesn't currently work I'd certainly like to fix that! According to your CI logs in the "install python dependencies" step it looks like pip is fetching the wheel with the correct binaries rather than the sdist ( In the meantime as a hacky workaround, you could just extract the .framework files directly from the wheel (since it's just a .zip file in disguise), include them in your project, and then set Can you send me a link to the built DMG? I can take a look and see if there's anything obvious on my end! |
Any of the succeeding CI jobs have a DMG in the summary https://github.com/C0rn3j/Tauon/actions/workflows/build_macOS.yaml For example this one - https://github.com/C0rn3j/Tauon/actions/runs/12376535920 -> dl |
Ah, just read up a bit more on pyinstaller and understand why pysdl2-dll doesn't work: basically it converts all the .py files to bytecode and bundles it all in a single binary, but pysdl2-dll works by a) bundling the platform-specific SDL2 binaries in a folder with the package source in the Maybe there's a way to modify pysdl2-dll to work with Pyinstaller somehow, but since the app-building process seems to bundle all the dylibs into the app's |
pyinstaller changes parts of paths with a Interestingly enough it still creates a . directory too anyway, it's just empty:
Someone with macOS (I do not have a Mac unfortunately, so I rely on testers) tried it, and it seems to at least detect sdl2dll, but fails anyway - could it be due to these UserWarning: Using SDL2 binaries from pysdl2-dll 2.30.10
Traceback (most recent call last):
File "sdl2/sdlimage.py", line 33, in <module>
File "sdl2/dll.py", line 253, in __init__
RuntimeError: could not find any library for SDL2_image (PYSDL2_DLL_PATH: /Applications/TauonMusicBox.app/Contents/Frameworks/sdl2dll/dll)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "tauon/__main__.py", line 63, in <module>
File "PyInstaller/loader/pyimod02_importers.py", line 384, in exec_module
File "sdl2/sdlimage.py", line 37, in <module>
ImportError: could not find any library for SDL2_image (PYSDL2_DLL_PATH: /Applications/TauonMusicBox.app/Contents/Frameworks/sdl2dll/dll)
[PYI-84800:ERROR] Failed to execute script '__main__' due to unhandled exception: could not find any library for SDL2_image (PYSDL2_DLL_PATH: /Applications/TauonMusicBox.app/Contents/Frameworks/sdl2dll/dll)
[PYI-84800:ERROR] Traceback:
Traceback (most recent call last):
File "sdl2/sdlimage.py", line 33, in <module>
File "sdl2/dll.py", line 253, in __init__
RuntimeError: could not find any library for SDL2_image (PYSDL2_DLL_PATH: /Applications/TauonMusicBox.app/Contents/Frameworks/sdl2dll/dll)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "tauon/__main__.py", line 63, in <module>
File "PyInstaller/loader/pyimod02_importers.py", line 384, in exec_module
File "sdl2/sdlimage.py", line 37, in <module>
ImportError: could not find any library for SDL2_image (PYSDL2_DLL_PATH: /Applications/TauonMusicBox.app/Contents/Frameworks/sdl2dll/dll) I am confused as to what should be done here if so... EDIT: Actually that looks like a pyinstaller bug... ".framework bundle directories are allowed to have dot in name" |
Thank you for your assistance, I got it working: datas=[
(".venv/lib/python3.13/site-packages/sdl2dll/dll", "sdl2dll/dll"),
] It did require one upstream fix from pyinstaller for macOS (as per the linked issue above), but with that one, it works on both Linux and macOS! |
I am attempting to use the pysdl2-dll library as per docs, but it seems like there are no prebuilt binaries, or I am installing it wrong, or more likely, I am shooting myself in the foot with pyinstaller.
I am trying to port Tauon to macOS in this PR branch - build logs with debug available in the CI jobs
It is built in the
macos-latest
GitHub runner, which to my understanding should have the prebuilt libraries from pysdl2-dll available, as it is new enough.The CI job - https://github.com/Taiko2k/Tauon/pull/1348/files - installs both pysdl2-dll and PySDL2, and I tried to add "pysdl2-dll" as a hidden import to pyinstaller for good measure, but it still persists.
Mounting the final DMG and executing the volume gets me the warning above, I seem to need system SDL to get it working still.
Which files exactly does pysdl2-dll expect to find that would count as prebuilt?
The text was updated successfully, but these errors were encountered: