libllvmlite.dylib error with py2app
Greetings,
A component of a py2app binary I am producing is the algorithm UMAP (dimensionality reduction method). This works fine with my local versions of python but when creating a frozen binary with py2app, UMAP fails due to a llvmlite error which I posted here:
https://stackoverflow.com/questions/53699054/umap-fails-upon-py2app-build-due-to-libllvmlite-dylib-error
I wasn't sure the best place to ask this question, but here seems appropriate. I have replicated this error on two different Mac's, both with py2app version 0.10 (other versions of py2app produced compilation errors). Everything else seems to be bundling properly.
Thanks, Nathan
OK, thanks for letting us know. @sklam will take a look.
It looks like the issue can be resolved by simply adding llvmlite to the "packages" in py2app; i.e. python setup.py py2app --packages llvmlite.
I think the reason is that py2app is zipping up the site-packages, causing the libllvmlite.dylib to be inside an archive when llvmlite tries to ctypes.CDLL load it. By adding "llvmlite" to "packages", the bundled app will have the llvmlite package available outside of the archive. Note, numpy is automatically placed outside of the archive. I think py2app may have special knowledge about numpy and other libraries that have DLL.
Final note, regular python C-extensions are fine because python can load them from zip. I don't know if we can load regular DLL from zip archive as easily.
Thank you Siu for the response. Your solution for Py2app works as I noted in the stackoverflow post.
Related to question related to loading regular DLL files from the zip, when I move to a PC with py2exe, I am also getting a llvmlite error:
File "numba_init_.pyc", line 11 in
This error indicates that a dependent DLL cannot be found. What dll's are called here by llvmlite on Windows?
A follow-up... I found the llvmlite.dll and copied that to the py2exe frozen directory and bypassed that error, so the question is how to get py2exe to recognize that dll and copy it over.
@nsalomonis, can you test if https://github.com/numba/llvmlite/pull/447 would help avoid manual specification of the DLLs?
What would be the specific edit to the py2exe script related to pkg_resources?