OSError: Python library not found: Python, .Python, libpython3.5.dylib

4,855 views
Skip to first unread message

al...@vitallabs.co

unread,
Sep 5, 2016, 8:14:25 AM9/5/16
to PyInstaller
Hello,

I'm trying to use pyinstaller to build an application on OSX. I'm in a virtual environment created using conda. When I run pyinstall I get the following error ...

OSError: Python library not found: Python, .Python, libpython3.5.dylib

Has anyone else encountered this error from a conda environment and is there a workaround?

Thanks!
Alan

davecortesi

unread,
Sep 6, 2016, 10:49:08 AM9/6/16
to PyInstaller

OSError: Python library not found: Python, .Python, libpython3.5.dylib

Craig Stark

unread,
Sep 16, 2016, 6:57:58 AM9/16/16
to PyInstaller
I've hit this error as well and Googling turned up some potential issues with the way the Anaconda library is currently built.  If you do an "otool -L" on that dylib, you'll see it doesn't have @rpath in front of it.  Macs are very picky in how they chose to load a dylib and names and locations need to match exactly.

Do yourself a favor... I just went through hours and hours of trying to get the current Anaconda working well to no avail.  I tried MacPorts to no avail.  I made a VM and used homebrew and everything works perfectly without any hint of mucking with anything.  Yes, I needed to install SciPy and stuff manually, but pip handled the vast majority of it just fine.  The one exception was PyQt, which needed "brew install pyqt" and that was it.

Craig

Val Huber

unread,
Aug 6, 2020, 12:35:59 PM8/6/20
to PyInstaller
The link is no longer valid.

I have hit the same issue, having tried a number of solutions including Dave's below.  (Warning, new Python user).

My project is here if you want to recreate: https://github.com/valhuber/fab-quickstart

My notes are in the project ($pyinstall fails.txt), highlights of solutions attempted:

running Mac, Catalina

cd fab_quickstart
pyinstaller cli.py   # fails...
    OSError: Python library not found: libpython3.8.dylib, libpython3.8m.dylib, Python, .Python
        This would mean your Python installation doesn't come with proper library files.
        This usually happens by missing development package, or unsuitable build parameters of Python installation.

        * On Debian/Ubuntu, you would need to install Python development packages
        * apt-get install python3-dev
        * apt-get install python-dev
        * If you're building Python by yourself, please rebuild your Python with `--enable-shared` (or, `--enable-framework` on Darwin)

    python installed via pyenv install 3.8.3, at:
        /Users/val/.pyenv/versions/3.8.3/lib/python3.8

Research found these suggestions, all failed in same way.....

    says set DYLD_LIBRARY_PATH  -- same result
        export DYLD_LIBRARY_PATH=/Users/val/.pyenv/versions/3.8.3/lib/python3.8
        or
        export DYLD_LIBRARY_PATH=/Users/val/.pyenv/versions/3.8.3-dev/lib/python3.8

    pyenv install 3.8-dev  -- same result

      libpython3.4m.so.1.0 --> /usr/lib -- but can't find mac version

      brew install pyqt  -- same result

legorooj

unread,
Aug 7, 2020, 3:35:34 AM8/7/20
to pyins...@googlegroups.com
All our documentation is hosted on pyinstaller.readthedocs.io - the python hosted URL just redirects to the home page of the docs.


Legorooj
-------- Original Message --------
--
You received this message because you are subscribed to the Google Groups "PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyinstaller...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pyinstaller/1c80e5fb-8d17-4b05-a45d-2e99ee204eaao%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages