RuntimeError when running a Python executable created with auto-py-to-exe on a client’s machine

127 Views Asked by At

We have developed a Dashboard in Python using the Dash library, which collects data via a Google Sheets API. To make the Dashboard accessible to our client, we converted our Python script into an executable file using auto-py-to-exe. This allows our client to use the Dashboard without needing to install Python or any additional libraries.

The executable runs perfectly on our own machines. However, when our client tries to run the executable on their machine, they encounter the following error:

Traceback (most recent call last):
  File "app.py", line 78, in <module>
  File "webview\_init_.py", line 155, in start
  File "webview\guilib.py", line 119, in initialize
  File "webview\guilib.py", line 71, in try_import
  File "webview\guilib.py", line 60, in import_winforms
  File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
  File "PyInstaller\loader\pyimod02_importers.py", line 419, in exec_module
  File "webview\platforms\winforms.py", line 12, in <module>
  File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
  File "PyInstaller\loader\pyimod02_importers.py", line 419, in exec_module
  File "clr.py", line 6, in <module>
  File "pythonnet\_init_.py", line 143, in load
  File "clr_loader\types.py", line 94, in get_function
  File "clr_loader\types.py", line 58, in _init_
  File "clr_loader\netfx.py", line 47, in _get_callable
RuntimeError: Failed to resolve Python.Runtime.Loader.Initialize from C:\Users\gusta\OneDrive\app\app\_internal\pythonet\runtime\Python.runtime

Our client does not have Python installed on their machine, and we would like them to be able to use the Dashboard without having to install Python or any other dependencies.

We have tried to make him open the executable on and outside the OneDrive, but it didn't work. When we tried to make it work in one of my friend's computer, which didn't work in the first try, it started working when we compiled it in his computer. How can we make it work in our client's computer without him having to compile the code in his computer?

0

There are 0 best solutions below