CadQuery / CQ-editor

CadQuery GUI editor based on PyQT
Apache License 2.0
725 stars 112 forks source link

Sources of cadquery and cq-editor currently out-of-sync for master? #346

Closed stylon closed 2 years ago

stylon commented 2 years ago

I'm in the process of trying CQ-editor for some projects and after a while with a working installation via conda (already on master with the GUI showing as 0.3.0-dev), I just decided to update to the recent master as I wanted to give the new perspective 3D view a try:

conda install -c cadquery -c conda-forge cq-editor=master

Unfortunately, that broke my installation as it seems that the pulled cadquery and cq-editor are somewhat out-of-sync. See the traceback here:

Traceback (most recent call last): File "/usr/anaconda3/envs/cadquery/bin/cq-editor", line 7, in from cq_editor.main import main File "/usr/anaconda3/envs/cadquery/lib/python3.9/site-packages/cq_editor/main.py", line 12, in from .main_window import MainWindow File "/usr/anaconda3/envs/cadquery/lib/python3.9/site-packages/cq_editor/main_window.py", line 5, in import cadquery as cq File "/usr/anaconda3/envs/cadquery/lib/python3.9/site-packages/cadquery/init.py", line 31, in from .assembly import Assembly, Color, Constraint File "/usr/anaconda3/envs/cadquery/lib/python3.9/site-packages/cadquery/assembly.py", line 10, in from .occ_impl.solver import ( File "/usr/anaconda3/envs/cadquery/lib/python3.9/site-packages/cadquery/occ_impl/solver.py", line 22, in class ConstraintSolver(object): File "/usr/anaconda3/envs/cadquery/lib/python3.9/site-packages/cadquery/occ_impl/solver.py", line 89, in ConstraintSolver Callable[[Array[(Any,), float]], float], File "/usr/anaconda3/envs/cadquery/lib/python3.9/site-packages/nptyping/ndarray.py", line 73, in getitem shape_expression, dtype = _get_from_tuple(item) File "/usr/anaconda3/envs/cadquery/lib/python3.9/site-packages/nptyping/ndarray.py", line 128, in _get_from_tuple raise InvalidArgumentsError( nptyping.error.InvalidArgumentsError: Unexpected argument '(typing.Any,)', expecting Shape[] or Literal[]

Both, cadquery and cq-editor show as 'master' with 'conda list', but when I check cadquery:master on github I see different code than installed. Actually, it looks like commit #6a440b63af5eb7dc7ee9ad569176908497fcca22 is installed whereas most recent master is already at commit #6217431d9865ec4f0e0bb9ecf7dfd1aa204fe809. The latest commit differs exactly at those suspicious lines in cadquery/occ_impl/solver.py around line #89.

And idea how this can be fixed?

jmwright commented 2 years ago

You can try the following to update your conda environment, but I usually start with a clean one if I run into issues.

conda remove cq-editor
conda clean --all --force-pkgs-dirs
conda install --force-reinstall -c conda-forge -c cadquery cq-editor=master
stylon commented 2 years ago

That didn't help directly. Still same error. I'll try with a fresh anaconda environment once I find the time.

stylon commented 2 years ago

Before starting from a fresh environment, I tried to also remove the cadquery and ocp installation from that anaconda3 environment and re-installed all 3 packages, but got stuck in an infinite loop at "flexibly solving environment" :-(.

Starting from the same anaconda3 installation, but a fresh new environment, did resolve the issue. Thanks a lot!