tpaviot / pythonocc-core

Python package for 3D geometry CAD/BIM/CAM
GNU Lesser General Public License v3.0
1.39k stars 380 forks source link

ImportError: cannot import name 'Geom_Plane' from 'OCC.Core.GeomAPI' #1372

Closed Bill-XU closed 1 month ago

Bill-XU commented 1 month ago

Hello,

I'm using PythonOCC on Windows. I have installed it by conda-forge, and am using Python3.11 Everything is fine, import completion works correctly as well that it prompts there is a class named "Geom_Plane" in OCC.Core.GeomAPI.

But when I ran the code,

from OCC.Core.GeomAPI import Geom_Plane

python gave me this error:

ImportError: cannot import name 'Geom_Plane' from 'OCC.Core.GeomAPI' (...\.conda\envs\python311\Lib\site-packages\OCC\Core\GeomAPI.py)

I have checked "GeomAPI.py", there is no such "Geom_Plane" in it. Is this a compilation issue? How to fix it?

Best regards, Bill

Tanneguydv commented 1 month ago

Try :

from OCC.Core.Geom import Geom_Plane

Bill-XU commented 1 month ago

Try :

from OCC.Core.Geom import Geom_Plane

@Tanneguydv

Thank you! (I also see there are related examples in pythonocc-demos, next time will check them first.)

Bill