Pyinstaller with venv (and Pyenv installed) --> Python library not found

72 Views Asked by At

I have a very simple module in Python and I would like to package it with Pyinstaller.

I am running everything within a venv virtual environment.

But, not matter what I try, I keep getting this error:

PyInstaller.exceptions.PythonLibraryNotFoundError: Python library not found: Python, .Python, Python3, libpython3.10.dylib
    This means your Python installation does not come with proper shared library files.
    This usually happens due to missing development package, or unsuitable build parameters of the Python installation.

    * On Debian/Ubuntu, you need to install Python development packages:
      * apt-get install python3-dev
      * apt-get install python-dev
    * If you are building Python by yourself, rebuild with `--enable-shared` (or, `--enable-framework` on macOS).

I have found many similar topic where it is suggested to run the following :

env PYTHON_CONFIGURE_OPTS="--enable-shared" pyenv install 3.10.2 or env PYTHON_CONFIGURE_OPTS="--enable-framework" pyenv install 3.4.4

Which I did... but no result.

It would be great if someone could explain why this happen and how to fix it.

Thanks.

0

There are 0 best solutions below