tpaviot / pythonocc-core

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

cannot import name 'VERSION' from 'OCC' #1360

Closed Bill-XU closed 3 months ago

Bill-XU commented 3 months ago

Hello,

I am new to PythonOCC and all related things. I have followed instructions and have installed OCCT 7.8.1 / SWIG 4.2.1 / PythonOCC 7.8.1. When I tried to run an example code from https://pythonocc-doc.readthedocs.io/en/latest/hellobox/ , I got some error. Among them, there is one that relates to the source code.

File .\.conda\envs\python310\lib\site-packages\OCC\Display\SimpleGui.py:25
     [22](./.conda/envs/python310/lib/site-packages/OCC/Display/SimpleGui.py:22) import sys
     [23](./.conda/envs/python310/lib/site-packages/OCC/Display/SimpleGui.py:23) from typing import Any, Callable, List, Optional, Tuple
---> [25](./.conda/envs/python310/lib/site-packages/OCC/Display/SimpleGui.py:25) from OCC import VERSION
     [26](./.conda/envs/python310/lib/site-packages/OCC/Display/SimpleGui.py:26) from OCC.Display.backend import load_backend, get_qt_modules
     [27](./.conda/envs/python310/lib/site-packages/OCC/Display/SimpleGui.py:27) from OCC.Display.OCCViewer import OffscreenRenderer

ImportError: cannot import name 'VERSION' from 'OCC'

Does anybody know how to resolve this error? Is it related to build and install processes?

Best regards, Bill

Bill-XU commented 3 months ago

sorry, it seems that the error above was caused by package conflicts, and after uninstalled unused conflicted package, it is fine now .