CadQuery / CQ-editor

CadQuery GUI editor based on PyQT
Apache License 2.0
723 stars 111 forks source link

An error occurred after packaging with pyinstaller.spec #407

Closed li-zheng-hao closed 1 year ago

li-zheng-hao commented 1 year ago

Error

Traceback (most recent call last):
  File "run.py", line 12, in <module>
    from cq_editor.__main__ import main
  File "PyInstaller\loader\pyimod02_importers.py", line 385, in exec_module
  File "cq_editor\__main__.py", line 12, in <module>
    from .main_window import MainWindow
  File "PyInstaller\loader\pyimod02_importers.py", line 385, in exec_module
  File "cq_editor\main_window.py", line 5, in <module>
    import cadquery as cq
  File "PyInstaller\loader\pyimod02_importers.py", line 385, in exec_module
  File "cadquery\__init__.py", line 11, in <module>
  File "PyInstaller\loader\pyimod02_importers.py", line 385, in exec_module
  File "cadquery\occ_impl\shapes.py", line 19, in <module>
ImportError: Failed to load vtkCommonDataModel: No module named vtkmodules.vtkCommonCore
[3776] Failed to execute script 'run' due to unhandled exception!

Reproduce Steps

  1. clone repo
  2. use conda create a virtual env with python 3.11
  3. pip install required dependencies
  4. use command pyinstaller pyinstaller.spec to pack project
  5. use command to run packaged exe file: ./dist/CQ-editor/CQ-editor.exe
  6. the exception info is printed in console window