Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

explore providing a single-binary build #29

Open
jgehrcke opened this issue Jun 2, 2023 · 1 comment
Open

explore providing a single-binary build #29

jgehrcke opened this issue Jun 2, 2023 · 1 comment

Comments

@jgehrcke
Copy link
Owner

jgehrcke commented Jun 2, 2023

Let's see.

Related:

$ env PYTHON_CONFIGURE_OPTS="--enable-shared" pyenv install 3.11.3
pyenv: /home/jp/.pyenv/versions/3.11.3 already exists
continue with installation? (y/N) y
Installing Python-3.11.3...
Installed Python-3.11.3 to /home/jp/.pyenv/versions/3.11.3
[jp:~/dev/goeffel] 3108-goeffel-dev jp/may2023-mod+* 1m8s
12:13:14 ± pyenv virtualenv 3.11.3 3113-goeffel-dev
[jp:~/dev/goeffel] 3108-goeffel-dev jp/may2023-mod+* 3s
12:14:01 ± pyenv local 3113-goeffel-dev
[jp:~/dev/goeffel] 3108-goeffel-dev jp/may2023-mod+*
12:14:06 ± pyenv activate 3113-goeffel-dev
pyenv-virtualenv: prompt changing will be removed from future release. configure `export PYENV_VIRTUALENV_DISABLE_PROMPT=1' to simulate the behavior.
[jp:~/dev/goeffel] 3113-goeffel-dev jp/may20
@jgehrcke
Copy link
Owner Author

jgehrcke commented Jun 2, 2023

I tried after a bit of experimentation

$ pip install . && pyinstaller --onefile goeffel/goeffel.py 
...
304 INFO: Note: NumExpr detected 16 cores but "NUMEXPR_MAX_THREADS" not set, so enforcing safe limit of 8.
304 INFO: NumExpr defaulting to 8 threads.
663 WARNING: Cannot find libfreetype-cb9caf6f.so.6.19.0 (needed by /home/jp/.pyenv/versions/3.11.3/envs/3113-goeffel-dev/lib/python3.11/site-packages/PIL/../Pillow.libs/libharfbuzz-3543f599.so.0.60710.0)
677 WARNING: Cannot find libbrotlicommon-92722cb2.so.1 (needed by /home/jp/.pyenv/versions/3.11.3/envs/3113-goeffel-dev/lib/python3.11/site-packages/PIL/../Pillow.libs/libbrotlidec-db4b3db6.so.1.0.9)
685 WARNING: Cannot find libpng16-cb42a3c6.so.16.39.0 (needed by /home/jp/.pyenv/versions/3.11.3/envs/3113-goeffel-dev/lib/python3.11/site-packages/PIL/../Pillow.libs/libfreetype-cb9caf6f.so.6.19.0)
685 WARNING: Cannot find libbrotlidec-db4b3db6.so.1.0.9 (needed by /home/jp/.pyenv/versions/3.11.3/envs/3113-goeffel-dev/lib/python3.11/site-packages/PIL/../Pillow.libs/libfreetype-cb9caf6f.so.6.19.0)
691 WARNING: Cannot find libwebp-3ee34a0b.so.7.1.6 (needed by /home/jp/.pyenv/versions/3.11.3/envs/3113-goeffel-dev/lib/python3.11/site-packages/PIL/../Pillow.libs/libwebpmux-ddfacf1d.so.3.0.11)
695 WARNING: Cannot find libwebp-3ee34a0b.so.7.1.6 (needed by /home/jp/.pyenv/versions/3.11.3/envs/3113-goeffel-dev/lib/python3.11/site-packages/PIL/../Pillow.libs/libwebpdemux-785dd7eb.so.2.0.12)
698 WARNING: Cannot find libsharpyuv-9340467d.so.0.0.0 (needed by /home/jp/.pyenv/versions/3.11.3/envs/3113-goeffel-dev/lib/python3.11/site-packages/PIL/../Pillow.libs/libwebp-3ee34a0b.so.7.1.6)
707 WARNING: Cannot find libgfortran-040039e1.so.5.0.0 (needed by /home/jp/.pyenv/versions/3.11.3/envs/3113-goeffel-dev/lib/python3.11/site-packages/numpy/core/../../numpy.libs/libopenblas64_p-r0-15028c96.3.21.so)
713 WARNING: Cannot find libquadmath-96973f99.so.0.0.0 (needed by /home/jp/.pyenv/versions/3.11.3/envs/3113-goeffel-dev/lib/python3.11/site-packages/numpy/core/../../numpy.libs/libgfortran-040039e1.so.5.0.0)
721 WARNING: Cannot find libXau-154567c4.so.6.0.0 (needed by /home/jp/.pyenv/versions/3.11.3/envs/3113-goeffel-dev/lib/python3.11/site-packages/PIL/../Pillow.libs/libxcb-3e83370d.so.1.1.0)
727 WARNING: Cannot find liblzma-95592ee6.so.5.4.2 (needed by /home/jp/.pyenv/versions/3.11.3/envs/3113-goeffel-dev/lib/python3.11/site-packages/PIL/../Pillow.libs/libtiff-b9364ff1.so.6.0.0)
727 WARNING: Cannot find libjpeg-f2134fdd.so.62.3.0 (needed by /home/jp/.pyenv/versions/3.11.3/envs/3113-goeffel-dev/lib/python3.11/site-packages/PIL/../Pillow.libs/libtiff-b9364ff1.so.6.0.0)
16606 INFO: Looking for eggs
16607 INFO: Using Python library /home/jp/.pyenv/versions/3.11.3/lib/libpython3.11.so.1.0
16613 INFO: Warnings written to /home/jp/dev/goeffel/build/goeffel/warn-goeffel.txt
16647 INFO: Graph cross-reference written to /home/jp/dev/goeffel/build/goeffel/xref-goeffel.html
16663 INFO: checking PYZ
16664 INFO: Building because toc changed
16664 INFO: Building PYZ (ZlibArchive) /home/jp/dev/goeffel/build/goeffel/PYZ-00.pyz
17633 INFO: Building PYZ (ZlibArchive) /home/jp/dev/goeffel/build/goeffel/PYZ-00.pyz completed successfully.
17648 INFO: checking PKG
17648 INFO: Building because toc changed
17648 INFO: Building PKG (CArchive) goeffel.pkg
30607 INFO: Building PKG (CArchive) goeffel.pkg completed successfully.
30612 INFO: Bootloader /home/jp/.pyenv/versions/3.11.3/envs/3113-goeffel-dev/lib/python3.11/site-packages/PyInstaller/bootloader/Linux-64bit-intel/run
30612 INFO: checking EXE
30613 INFO: Building because toc changed
30613 INFO: Building EXE from EXE-00.toc
30615 INFO: Copying bootloader EXE to /home/jp/dev/goeffel/dist/goeffel
30615 INFO: Appending PKG archive to custom ELF section in EXE
30692 INFO: Building EXE from EXE-00.toc completed successfully.

and then during execution:

± ./goeffel 
Traceback (most recent call last):
  File "PyInstaller/loader/pyimod03_ctypes.py", line 53, in __init__
  File "ctypes/__init__.py", line 376, in __init__
OSError: libblosc2.so: cannot open shared object file: No such file or directory

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "tables/__init__.py", line 26, in <module>
  File "ctypes/__init__.py", line 454, in LoadLibrary
  File "PyInstaller/loader/pyimod03_ctypes.py", line 55, in __init__
pyimod03_ctypes.install.<locals>.PyInstallerImportError: Failed to load dynlib/dll 'libblosc2.so'. Most likely this dynlib/dll was not found when the application was frozen.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "PyInstaller/loader/pyimod03_ctypes.py", line 53, in __init__
  File "ctypes/__init__.py", line 376, in __init__
OSError: /tmp/_MEI2KeoWB/tables/libblosc2.so: cannot open shared object file: No such file or directory

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "goeffel/goeffel.py", line 58, in <module>
  File "<frozen importlib._bootstrap>", line 1178, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1149, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
  File "PyInstaller/loader/pyimod02_importers.py", line 352, in exec_module
  File "tables/__init__.py", line 28, in <module>
  File "ctypes/__init__.py", line 454, in LoadLibrary
  File "PyInstaller/loader/pyimod03_ctypes.py", line 55, in __init__
pyimod03_ctypes.install.<locals>.PyInstallerImportError: Failed to load dynlib/dll '/tmp/_MEI2KeoWB/tables/libblosc2.so'. Most likely this dynlib/dll was not found when the application was frozen.
[3285364] Failed to execute script 'goeffel' due to unhandled exception!

First: better separation of concerns between goeffel and goeffel-analysis, in terms of dependencies.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant