I would like to make a Mac executable for my Python code but always got this error message:
OSError: Python library not found: .Python, libpython3.5.dylib, Python
Both PyInstaller and py2app returned the same error. What should I do to overcome this problem?
For Mac, try rebuild python to generated shared lib using:
env PYTHON_CONFIGURE_OPTS="--enable-framework" pyenv install 3.5.x
as said in pyenv offical doc
in which 3.5.x
is version of python which you are using
For my here, after reinstall python:
env PYTHON_CONFIGURE_OPTS="--enable-framework" pyenv install 3.8.0
the dylib located in
~/.pyenv/versions/3.8.0/Python.framework/Versions/3.8/lib/libpython3.8.dylib
which is soft link to 3.4MB file:
~/.pyenv/versions/3.8.0/Python.framework/Versions/3.8/Python
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With