dimanche 22 janvier 2023

Pyinstaller exe not working on target machine but works in source machine. ImportError of lazylinker(theano)

I am working on RHEL-9.1 with python version 3.7.9 installed. After converting my python source to exe using pyinstaller, My executable works fine in the same machine but it fails with the import error of lazylinker when executed the exe file in non-python installed RHEL-9.1 environment.

Versions :

Python-3.7.9 PyInstaller-3.6

Below is the Detailed Error:

You can find the C code in this temporary file:

`/tmp/theano_compilation_error_208c3d4e
library python3.7m is not found.
Check if package python-dev 3.7 or python-devel 3.7 is installed.
Stop Application Exception
Traceback (most recent call last):
  File "theano/gof/lazylinker_c.py", line 128, in <module>
ImportError: Version check of the existing lazylinker compiled file. Looking for version 0.211, but found None. Extra debug information: force_compile=False, _need_reload=True

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "theano/gof/lazylinker_c.py", line 182, in <module>
ImportError: Version check of the existing lazylinker compiled file. Looking for version 0.211, but found None. Extra debug information: force_compile=False, _need_reload=True

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "theano/gof/vm.py", line 674, in <module>
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
  File "/home/user/.local/lib/python3.7/site-packages/PyInstaller/loader/pyimod03_importers.py", line 623, in exec_module
  File "theano/gof/lazylinker_c.py", line 226, in <module>
  File "theano/gof/cmodule.py", line 2411, in compile_str
Exception: Compilation failed (return status=1): /usr/bin/ld: cannot find -lpython3.7m. collect2: error: ld returned 1 exit status.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "Application.py", line 173, in stop_application
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
  File "/home/user/.local/lib/python3.7/site-packages/PyInstaller/loader/pyimod03_importers.py", line 623, in exec_module
line 623, in exec_module
  File "keras/__init__.py", line 3, in <module>
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
  File "/home/user/.local/lib/python3.7/site-packages/PyInstaller/loader/pyimod03_importers.py", line 623, 
  File "theano/gof/vm.py", line 683, in <module>
AttributeError: module 'theano' has no attribute 'gof'
`

Aucun commentaire:

Enregistrer un commentaire