[SOLVED] [CadQuery + PyInstaller] - ModuleNotFoundError: No module named 'OCP' #1300
Replies: 3 comments 3 replies
-
You could look at how pyinstaller is used for the CQ-editor builds. https://github.com/jmwright/CQ-editor/blob/master/.github/workflows/pyinstaller-builds-actions.yml |
Beta Was this translation helpful? Give feedback.
-
This line is probably the most relevant in the action, and there might be things to review in the pyinstaller spec. Notice that I had to copy some dependency libraries manually in the Action. I've found pyinstaller difficult to get working initially. |
Beta Was this translation helpful? Give feedback.
-
Hi everyone. I will let it open to explain how I found a way to compile it. The library that I found that compiles it correctly was: https://cx-freeze.readthedocs.io/en/latest/ After compiling it and trying to open, found a lot of small .dll not implemented in the Dist file originated. But then the process was just copy and paste those in the correct folder and voala, its working now. I highly reccomend cx-freeze, especially for debugging, because it was the most straight forward one with what should I do to work around. Thanks for all. |
Beta Was this translation helpful? Give feedback.
-
Hi everyone!
I'm a Mechanical Engineer working on automatizing some CADs that we use here inside WEG company. Problem is that my work works flawesly in any machine that installs Conda + Cadquery + Vscode + Python... But this is completely not pratical. I need to create an executable file for any part of my company world around be able to use it.
Error:
Traceback (most recent call last):
File "GerarSobrebases1Chapa.py", line 6, in
File "PyInstaller\loader\pyimod02_importers.py", line 352, in exec_module
File "drawing3D.py", line 1, in
File "PyInstaller\loader\pyimod02_importers.py", line 352, in exec_module
File "cadquery_init_.py", line 10, in
File "PyInstaller\loader\pyimod02_importers.py", line 352, in exec_module
File "cadquery\occ_impl\geom.py", line 5, in
ModuleNotFoundError: No module named 'OCP'
Does someone knows how to fix it? I've tried to use pyinstaller with/out --hidden-import. I've tried to use nuitka too (and gives the same problem). I've tried to import cadquery as a folder in my project. Nothing have worked out yet.
I really need help. Thanks for all!
Beta Was this translation helpful? Give feedback.
All reactions