CadQuery / cadquery

A python parametric CAD scripting framework based on OCCT
https://cadquery.readthedocs.io
Other
3.06k stars 284 forks source link

AttributeError: type object 'OCP.BRepGProp.BRepGProp' has no attribute 'LinearProperties_s' #925

Open mikessut opened 2 years ago

mikessut commented 2 years ago

To Reproduce

Basic install following the documentation.

conda create --name cadquery
conda activate cadquery
conda install -c conda-forge -c cadquery cadquery=2

python
import cadquery

Backtrace

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\users\xxx\Anaconda3\envs\cadquery\lib\site-packages\cadquery\__init__.py", line 3, in <module>
    from .occ_impl.shapes import (
  File "C:\users\xxx\Anaconda3\envs\cadquery\lib\site-packages\cadquery\occ_impl\shapes.py", line 234, in <module>
    ta.TopAbs_EDGE: BRepGProp.LinearProperties_s,
AttributeError: type object 'OCP.BRepGProp.BRepGProp' has no attribute 'LinearProperties_s'

Environment

OS:

Windows

Was CadQuery installed using Conda?: Output of conda list from your active Conda environment:

# Name                    Version                   Build  Channel
aiocontextvars            0.2.2                      py_0    conda-forge
backports                 1.0                        py_2    conda-forge
backports.functools_lru_cache 1.6.4              pyhd8ed1ab_0    conda-forge
bzip2                     1.0.8                h8ffe710_4    conda-forge
ca-certificates           2021.10.8            h5b45459_0    conda-forge
cadquery                  master                    py3.6    cadquery
certifi                   2020.6.20          pyhd3eb1b0_3
colorama                  0.4.4              pyh9f0ad1d_0    conda-forge
contextvars               2.4                        py_0    conda-forge
curl                      7.80.0               h789b8ee_0    conda-forge
decorator                 5.1.0              pyhd8ed1ab_0    conda-forge
double-conversion         3.1.5                h0e60522_2    conda-forge
eigen                     3.4.0                h2d74725_0    conda-forge
expat                     2.4.1                h39d44d4_0    conda-forge
ezdxf                     0.14.2                     py_0    conda-forge
ffmpeg                    4.3.1                ha925a31_0    conda-forge
font-ttf-dejavu-sans-mono 2.37                 hab24e00_0    conda-forge
font-ttf-inconsolata      3.000                h77eed37_0    conda-forge
font-ttf-source-code-pro  2.038                h77eed37_0    conda-forge
font-ttf-ubuntu           0.83                 hab24e00_0    conda-forge
fontconfig                2.13.1            h1989441_1005    conda-forge
fonts-conda-ecosystem     1                             0    conda-forge
fonts-conda-forge         1                             0    conda-forge
freeimage                 3.18.0               hfcb8cd7_7    conda-forge
freetype                  2.10.4               h546665d_1    conda-forge
gl2ps                     1.4.2                h0597ee9_0    conda-forge
glew                      2.1.0                h39d44d4_2    conda-forge
hdf4                      4.2.15               h0e5069d_3    conda-forge
hdf5                      1.10.6          nompi_he0bbb20_101    conda-forge
ilmbase                   2.5.5                h12d4b20_0    conda-forge
immutables                0.16             py36h68aa20f_0    conda-forge
intel-openmp              2021.4.0          h57928b3_3556    conda-forge
ipython                   5.8.0                    py36_1    conda-forge
ipython_genutils          0.2.0                      py_1    conda-forge
jbig                      2.1               h8d14728_2003    conda-forge
jpeg                      9d                   h8ffe710_0    conda-forge
jsoncpp                   1.9.4                h2d74725_3    conda-forge
jxrlib                    1.1                  h8ffe710_2    conda-forge
krb5                      1.19.2               h6da9e4a_3    conda-forge
lcms2                     2.12                 h2a16943_0    conda-forge
lerc                      3.0                  h0e60522_0    conda-forge
libblas                   3.9.0                     8_mkl    conda-forge
libcblas                  3.9.0                     8_mkl    conda-forge
libcurl                   7.80.0               h789b8ee_0    conda-forge
libdeflate                1.8                  h8ffe710_0    conda-forge
libiconv                  1.16                 he774522_0    conda-forge
liblapack                 3.9.0                     8_mkl    conda-forge
libnetcdf                 4.8.0           nompi_hf689e7d_103    conda-forge
libogg                    1.3.4                h8ffe710_1    conda-forge
libpng                    1.6.37               h1d00b33_2    conda-forge
libraw                    0.20.2               hee1bdec_1    conda-forge
libssh2                   1.10.0               h9a1e1f7_2    conda-forge
libtheora                 1.1.1             h8d14728_1005    conda-forge
libtiff                   4.3.0                hd413186_2    conda-forge
libwebp-base              1.2.1                h8ffe710_0    conda-forge
libxml2                   2.9.12               hf5bbc77_1    conda-forge
libzip                    1.8.0                h519de47_1    conda-forge
libzlib                   1.2.11            h8ffe710_1013    conda-forge
loguru                    0.5.3            py36ha15d459_2    conda-forge
lz4-c                     1.9.3                h8ffe710_1    conda-forge
m2w64-gcc-libgfortran     5.3.0                         6    conda-forge
m2w64-gcc-libs            5.3.0                         7    conda-forge
m2w64-gcc-libs-core       5.3.0                         7    conda-forge
m2w64-gmp                 6.1.0                         2    conda-forge
m2w64-libwinpthread-git   5.0.0.4634.697f757               2    conda-forge
mkl                       2020.4             hb70f87d_311    conda-forge
msys2-conda-epoch         20160418                      1    conda-forge
nptyping                  1.4.4              pyhd8ed1ab_0    conda-forge
numpy                     1.19.5           py36h4b40d73_2    conda-forge
occt                      7.5.3                h60997fb_0    conda-forge
ocp                       7.5beta                 1_py3.6    cadquery
openexr                   2.5.5                hab3b255_0    conda-forge
openjpeg                  2.4.0                hb211442_1    conda-forge
openssl                   3.0.0                h8ffe710_2    conda-forge
pickleshare               0.7.5                   py_1003    conda-forge
pip                       21.3.1             pyhd8ed1ab_0    conda-forge
proj                      7.2.0                h1cfcee9_2    conda-forge
prompt_toolkit            1.0.15                     py_1    conda-forge
pugixml                   1.11.4               h0e60522_0    conda-forge
pygments                  2.10.0             pyhd8ed1ab_0    conda-forge
pyparsing                 2.4.7              pyhd8ed1ab_1    conda-forge
python                    3.6.13          h39d44d4_2_cpython    conda-forge
python_abi                3.6                     2_cp36m    conda-forge
rapidjson                 1.1.0             ha925a31_1002    conda-forge
scipy                     1.5.3            py36h27d303f_1    conda-forge
setuptools                49.6.0           py36ha15d459_3    conda-forge
simplegeneric             0.8.1                      py_1    conda-forge
six                       1.16.0             pyh6c4a22f_0    conda-forge
sqlite                    3.37.0               h8ffe710_0    conda-forge
tbb                       2020.2               h2d74725_4    conda-forge
tbb-devel                 2020.2               h2d74725_4    conda-forge
tk                        8.6.11               h8ffe710_1    conda-forge
traitlets                 4.3.3              pyhd8ed1ab_2    conda-forge
typing-extensions         4.0.0                hd8ed1ab_0    conda-forge
typing_extensions         4.0.0              pyha770c72_0    conda-forge
typish                    1.9.3              pyhd8ed1ab_0    conda-forge
ucrt                      10.0.20348.0         h57928b3_0    conda-forge
utfcpp                    3.2.1                h57928b3_0    conda-forge
vc                        14.2                 hb210afc_5    conda-forge
vs2015_runtime            14.29.30037          h902a5da_5    conda-forge
vtk                       9.0.1           no_osmesa_py36h2bf8032_107    conda-forge
wcwidth                   0.2.5              pyh9f0ad1d_2    conda-forge
wheel                     0.37.0             pyhd8ed1ab_1    conda-forge
win32_setctime            1.0.4              pyhd8ed1ab_0    conda-forge
wincertstore              0.2             py36ha15d459_1006    conda-forge
xz                        5.2.5                h62dcd97_1    conda-forge
zlib                      1.2.11            h8ffe710_1013    conda-forge
zstd                      1.5.0                h6255e5f_0    conda-forge

Using:

mikessut commented 2 years ago

Reverting to version 2 appears to work.

conda install -c conda-forge -c cadquery cadquery=2
adam-urbanczyk commented 2 years ago

Does it work with cadquery=master and ocp=7.5.2?

evenprimes commented 2 years ago

After running conda install -c conda-forge -c cadquery ocp=7.5.2 I was able to import cadquery and performing the initial checkout.

esotericbyte commented 2 years ago

This is also a documentation bug since the directions here are broken: https://cadquery.readthedocs.io/en/latest/installation.html conda install -c cadquery -c conda-forge cadquery=master fails conda install -c cadquery -c conda-forge cadquery=master ocp=7.5.2 works as expected.

adam-urbanczyk commented 2 years ago

This is also a documentation bug since the directions here are broken: https://cadquery.readthedocs.io/en/latest/installation.html conda install -c cadquery -c conda-forge cadquery=master fails conda install -c cadquery -c conda-forge cadquery=master ocp=7.5.2 works as expected.

Fails how? Was your first cadquery install? Or was the package taken from the local cache maybe?

esotericbyte commented 2 years ago

Fails how? Was your first cadquery install? Or was the package taken from the local cache maybe?

It was the first time.

If you don't specify python version for some reason it's diving to 3.6 and then using that build of ocp. The following worked: conda create -n cadquery python=3.9 conda activate cadquery conda install -c cadquery -c conda-forge cadquery=master

One clear set of instructions that work without discussion of alternatives and including cq-editor would best serve most users.

The "master" branch has been changed in many repositories to "main". See https://github.com/github/renaming

adam-urbanczyk commented 2 years ago

I cannot reproduce the story with 3.6 being installed by default. Was it already there?

esotericbyte commented 2 years ago

To see the behavior start with a fresh environment and without the python version specified and nothing else installed. conda create -n cadquery I believe you have something installed in the environment that is hoisting the python version. This is a condition that triggers the error in the op.

ocp 7.5.2 is specified in meta.yaml In the error case it's using 7.5beta Do you think it needs a = - ocp =7.5.2