pythonocc-core icon indicating copy to clipboard operation
pythonocc-core copied to clipboard

No module named 'OCC.BRepPrimAPI'

Open billtubbs opened this issue 3 years ago • 1 comments

Completely new to OCC. Installed it on Mac OS into a Python 3.9 environment using the command on the readme but the first line of the HelloBox tutorial raises an error:

In [1]: import OCC

In [2]: help(OCC)


In [3]: from OCC.BRepPrimAPI import BRepPrimAPI_MakeBox
---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
Cell In [3], line 1
----> 1 from OCC.BRepPrimAPI import BRepPrimAPI_MakeBox

ModuleNotFoundError: No module named 'OCC.BRepPrimAPI'
$ conda list occ*
# packages in environment at /Users/<myusername>/opt/anaconda3/envs/occ:
#
# Name                    Version                   Build  Channel
occt                      7.6.2                h1c46427_3    conda-forge
ptyprocess                0.7.0              pyhd3deb0d_0    conda-forge
pythonocc-core            7.6.2            py39hdcc9b3b_0    conda-forge

The second import statement and imports from other tutorials work fine.

Am I missing some dependency or what could this be?

billtubbs avatar Oct 04 '22 04:10 billtubbs

Oh wait, should it be:

from OCC.Core.BRepPrimAPI import BRepPrimAPI_MakeBox

Maybe the tutorial code is out of date.

billtubbs avatar Oct 04 '22 04:10 billtubbs