pyinstallerpymeshlab

Import error when using pymeshlab and Pyinstaller


I am currently writing a program using pymeshlab, which I would like to deploy using pyinstaller. After I deployed the program, I tried to run it and got the folowing error.

[78981] Module object for struct is NULL!
Traceback (most recent call last):
File "struct.py", line 13, in <module>
ModuleNotFoundError: No module named '_struct'
[78981] Module object for pyimod02_archive is NULL!
Traceback (most recent call last):
File "PyInstaller/loader/pyimod02_archive.py", line 27, in <module>
ModuleNotFoundError: No module named 'struct'
[78981] Module object for pyimod03_importers is NULL!
Traceback (most recent call last):
File "PyInstaller/loader/pyimod03_importers.py", line 23, in <module>
ModuleNotFoundError: No module named 'pyimod02_archive'
Traceback (most recent call last):
File "PyInstaller/loader/pyiboot01_bootstrap.py", line 17, in <module>
ModuleNotFoundError: No module named 'pyimod03_importers'
[78981] Failed to execute script 'pyiboot01_bootstrap' due to unhandled exception!

After some search I found that the major problem must be in PyMeshLab. I am know running the following code,

import pymeshlab

def main():
  print('Hello World')

if __name__ == '__main__':
  main()

and I still get the error. Does anyone have an idea, how this can be fixed?

I am using Ubuntu 22.04


Solution

  • What can be used instead of pyinstaller cx_freeze. Using cx_freeze the applications runs fine!