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

Pyinstaller compatibility #922

Open
skornel02 opened this issue Oct 12, 2022 · 1 comment
Open

Pyinstaller compatibility #922

skornel02 opened this issue Oct 12, 2022 · 1 comment

Comments

@skornel02
Copy link

Hi,
I am currently trying to compile the following simple python script to an executable with PyInstaller:

import skl2onnx
print("hello world!")

I am not very familiar with the ecosystem so I'm interested if this is something that may or may not even work or has anyone managed to make this work.

Output of the executable (on Windows w/ Python 3.7.1)
Traceback (most recent call last):
  File "test.py", line 1, in 
  File "", line 983, in _find_and_load
  File "", line 967, in _find_and_load_unlocked
  File "", line 677, in _load_unlocked
  File "PyInstaller\loader\pyimod02_importers.py", line 499, in exec_module
  File "skl2onnx\__init__.py", line 15, in 
  File "", line 983, in _find_and_load
  File "", line 967, in _find_and_load_unlocked
  File "", line 677, in _load_unlocked
  File "PyInstaller\loader\pyimod02_importers.py", line 499, in exec_module
  File "skl2onnx\convert.py", line 6, in 
  File "", line 983, in _find_and_load
  File "", line 967, in _find_and_load_unlocked
  File "", line 677, in _load_unlocked
  File "PyInstaller\loader\pyimod02_importers.py", line 499, in exec_module
  File "skl2onnx\common\_topology.py", line 35, in 
  File "", line 983, in _find_and_load
  File "", line 967, in _find_and_load_unlocked
  File "", line 677, in _load_unlocked
  File "PyInstaller\loader\pyimod02_importers.py", line 499, in exec_module
  File "skl2onnx\common\_container.py", line 89, in 
  File "skl2onnx\common\_container.py", line 49, in _get_operation_list
  File "inspect.py", line 973, in getsource
  File "inspect.py", line 955, in getsourcelines
  File "inspect.py", line 786, in findsource
OSError: could not get source code
[1788] Failed to execute script 'test' due to unhandled exception!
   

Thank you for your help in advance!

@xadupre
Copy link
Collaborator

xadupre commented Oct 13, 2022

I guess inpsect expects to see physical files but pyinstaller removes the physical file. It could happen with other modules. The code using inpsect is just doing validation and could be disabled.

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

No branches or pull requests

2 participants