installation error (cq-editor, Win10)

761 views
Skip to first unread message

Kawayanan K

unread,
Oct 31, 2020, 4:40:12 PM10/31/20
to CadQuery
Hello,

I have really like cadquery for designing simple bits to 3d-print (https://www.thingiverse.com/kawayanan/designs), and have used v1 within freecad.  I really want to try cq-editor though but cannot get it to install and run.

I hadn't used Anaconda before, so I went with Miniconda (Python 3.8, Win 64 bit).  That seems to work fine, and I followed the cq-editor install instructions (conda install -c cadquery -c conda-forge cq-editor=master).  When I try to run cq-editor (from the Start menu icon), I just get a blank black cq-editor window.  When I try to run from the anaconda shell, I get the following error trace:

(base) PS C:\Users\Me> cq-editor
Traceback (most recent call last):
  File "C:\Users\Me\miniconda3\Scripts\CQ-editor-script.py", line 6, in <module>
    from cq_editor.__main__ import main
  File "C:\Users\Me\miniconda3\lib\site-packages\cq_editor\__main__.py", line 12, in <module>
    from .main_window import MainWindow
  File "C:\Users\Me\miniconda3\lib\site-packages\cq_editor\main_window.py", line 5, in <module>
    import cadquery as cq
  File "C:\Users\Me\miniconda3\lib\site-packages\cadquery\__init__.py", line 2, in <module>
    from .occ_impl.geom import Plane, BoundBox, Vector, Matrix, Location
  File "C:\Users\Me\miniconda3\lib\site-packages\cadquery\occ_impl\geom.py", line 5, in <module>
    from OCP.gp import gp_Vec, gp_Ax1, gp_Ax3, gp_Pnt, gp_Dir, gp_Trsf, gp_GTrsf, gp, gp_XYZ
ImportError: DLL load failed while importing OCP: The specified module could not be found.

In an attempt to get past this, I also followed the cadquery install instructions (conda install -c conda-forge -c cadquery cadquery=master), as well as the OCP install instructions (conda install -c conda-forge -c cadquery ocp).  I assumed the anaconda should get all the dependencies for the cq-editor install, but wanted to make sure.  As far as I can tell, everything installed sucessfully.

I can't find anything on the web about this error, but would like to be able to try cq-editor.  Any suggestions on what I am doing wrong?

Thanks!

Kawayanan




trayracing

unread,
Oct 31, 2020, 9:01:41 PM10/31/20
to CadQuery
You're not alone. I updated Anaconda and now I get the same error with cq-editor main.
I'm on python 3.7.9.

Adam Urbanczyk

unread,
Nov 1, 2020, 7:14:57 AM11/1/20
to CadQuery

Are you able to identify which DLL is missing (using for example ntldd)?

Otherwise, please please paste the following information

conda list

conda info --all

Kawayanan K

unread,
Nov 1, 2020, 6:58:20 PM11/1/20
to CadQuery
I attached the output of conda list and conda info --all.  After that I installed ntldd, but I am not sure how to use it and cannot find instructions.  (sorry, new to this).  If I tried "ntldd cq-editor" I get the following:

(base) C:\Users\Me>ntldd cq-editor
        ADVAPI32.dll => C:\Windows\SYSTEM32\ADVAPI32.dll (0x0000000000620000)
        KERNEL32.dll => C:\Windows\SYSTEM32\KERNEL32.dll (0x00000000006c0000)
        msvcrt.dll => C:\Windows\SYSTEM32\msvcrt.dll (0x00000000006c0000)
        SHELL32.dll => C:\Windows\SYSTEM32\SHELL32.dll (0x0000000001230000)

Thanks.
conda packages.txt

trayracing

unread,
Nov 2, 2020, 6:59:26 AM11/2/20
to CadQuery
I don't know why updating my existing cq-editor env (python 3.7, win10) made cq-editor not run with the same problem as Kawayanan's setup.
So I created a new environment with python 3.8 in conda and did 
conda install -c cadquery -c conda-forge cq-editor=master
That launches CQ-editor just fine!

Looks like conda struggled a bit in the process:
conda install -c cadquery -c conda-forge cq-editor=master
Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.
Collecting package metadata (repodata.json): done
Solving environment: done
...(more normal stuff here)...


I know very little about conda, so I don't know if that's cqe specific, or something amiss in my local conda setup. In any case, I'm unblocked.

Adam Urbanczyk

unread,
Nov 2, 2020, 2:41:10 PM11/2/20
to CadQuery
Kawayanan, could you try if this fix works for you too?

Kawayanan K

unread,
Nov 8, 2020, 12:36:56 AM11/8/20
to CadQuery
This fix did not work for me.  I started with a fresh install of  python 3.8 in miniconda3 and used the same command to install cq-editor.

I have reinstalled a number of times now using various versions, but haven't found anything that fixes the problem.

I finally gave up on the Windows version and went a more complicated route.  I installed Ubuntu in Win10 using WSL2, and then also installed a X server ( VcXsrv Windows X Server) in order to run linux GUI programs on Win10.  Tee conda and cq-editor installs went smoothly and it runs.  A bit of a strange workaround but I now get to play with cq-editor instead of using FreeCAD.

I'm still interested in running the windows version if anyone figures out what might be going wrong.

Thanks everyone!

Adam Urbanczyk

unread,
Nov 8, 2020, 11:03:35 AM11/8/20
to CadQuery
Could you try running this:

ntldd -R %CONDA_PREFIX%\Lib\site-packages\OCP.cp38-win_amd64.pyd

Probably you are missing the visual studio redistributable: https://support.microsoft.com/en-us/help/2977003/the-latest-supported-visual-c-downloads

Kawayanan K

unread,
Nov 8, 2020, 4:19:27 PM11/8/20
to CadQuery
Installing the visual studio  C++ redistributable package worked.  When I ran the ntldd command you gave, there were a lot of dll's not found.  After doing the install, there are still some dll's not found, but many fewer.  cq-editor runs though.

Thank you!    

Reply all
Reply to author
Forward
0 new messages