asdf-community / asdf-python

Python plugin for the asdf version manager
https://github.com/asdf-vm/asdf
MIT License
651 stars 56 forks source link

pyinstaller is missing libraries when using python from asdf ? [OSX] #89

Open a4z opened 3 years ago

a4z commented 3 years ago

I am trying to package a software (conan) with a pyinstaller script (from that project and that is proven to work)

But I run into a problem

...
9915 INFO: Looking for dynamic libraries
9995 INFO: Looking for eggs
9995 INFO: Python library not in binary dependencies. Doing additional searching...
Traceback (most recent call last):
  File "/Users/a4z/.asdf/installs/python/3.6.12/bin/pyinstaller", line 8, in <module>
    sys.exit(run())
  File "/Users/a4z/.asdf/installs/python/3.6.12/lib/python3.6/site-packages/PyInstaller/__main__.py", line 114, in run
    run_build(pyi_config, spec_file, **vars(args))
  File "/Users/a4z/.asdf/installs/python/3.6.12/lib/python3.6/site-packages/PyInstaller/__main__.py", line 65, in run_build
    PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs)
  File "/Users/a4z/.asdf/installs/python/3.6.12/lib/python3.6/site-packages/PyInstaller/building/build_main.py", line 725, in main
    build(specfile, kw.get('distpath'), kw.get('workpath'), kw.get('clean_build'))
  File "/Users/a4z/.asdf/installs/python/3.6.12/lib/python3.6/site-packages/PyInstaller/building/build_main.py", line 672, in build
    exec(code, spec_namespace)
  File "/Users/a4z/work/py/conan/pyinstaller/conan.spec", line 17, in <module>
    noarchive=False)
  File "/Users/a4z/.asdf/installs/python/3.6.12/lib/python3.6/site-packages/PyInstaller/building/build_main.py", line 242, in __init__
    self.__postinit__()
  File "/Users/a4z/.asdf/installs/python/3.6.12/lib/python3.6/site-packages/PyInstaller/building/datastruct.py", line 160, in __postinit__
    self.assemble()
  File "/Users/a4z/.asdf/installs/python/3.6.12/lib/python3.6/site-packages/PyInstaller/building/build_main.py", line 476, in assemble
    self._check_python_library(self.binaries)
  File "/Users/a4z/.asdf/installs/python/3.6.12/lib/python3.6/site-packages/PyInstaller/building/build_main.py", line 569, in _check_python_library
    python_lib = bindepend.get_python_library_path()
  File "/Users/a4z/.asdf/installs/python/3.6.12/lib/python3.6/site-packages/PyInstaller/depend/bindepend.py", line 945, in get_python_library_path
    raise IOError(msg)
OSError: Python library not found: Python3, Python, libpython3.6m.dylib, .Python, libpython3.6.dylib
    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)

does that mean asdf python misses libraries on OSX?

yssource commented 3 years ago

The same problem happens to Linux also. missing the shared libs. OSError: Python library not found: libpython3.7m.so.1.0, libpython3.7m.so, libpython3.7mu.so.1.0, libpython3.7.so.1.0

yssource commented 3 years ago

https://github.com/pyenv/pyenv/wiki#how-to-build-cpython-with-framework-support-on-os-x

https://github.com/pyenv/pyenv/wiki#how-to-build-cpython-with---enable-shared