coin3d/pivy

circular import error

iplayfast opened this issue · 16 comments

I've just cloned and installed coin, I then cloned and installed pivy.
trying to import pivy gives.

python
Python 3.10.6 (main, Nov 14 2022, 16:10:14) [GCC 11.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.

import pivy
Traceback (most recent call last):
File "", line 1, in
File "/home/chris/github/pivy/build/pivy/init.py", line 30, in
from .coin import SoDB, SoNodeKit, SoInteraction
File "/home/chris/github/pivy/build/pivy/coin.py", line 21, in
from . import _coin
ImportError: cannot import name '_coin' from partially initialized module 'pivy' (most likely due to a circular import) (/home/chris/github/pivy/build/pivy/init.py)

maybe you can try to run python from the home-directory. If you have installed pivy python should use the installed version.

To be clear. I cloned and installed coin, (cd build;cmake ..;make;sudo make install). Then cloned and installed pivy (cd build;cmake ..;make;sudo make install). So should be a clean fresh install.

Going to a new terminal (directory is ~) I typed
python
import pivy

and got the error.

Did you try and find a different result?

I am having the same problem. Downloaded and installed coin, soqt and quarter from sources per instructions in INSTALL and did not have any errors. Using the compile/install instructions for pivy I see the same problem
`
~/Downloads/Coin3D/pivy/build$ cmake ..
-- COIN_FOUND: TRUE
-- COIN_INCLUDE_DIR: /usr/local/include
-- COIN_LIB_DIR: /usr/local/lib
-- COIN_VERSION: 4.0.1
CMake Warning at /usr/share/cmake-3.22/Modules/CMakeFindDependencyMacro.cmake:47 (find_package):
By not providing "FindQt5Core.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "Qt5Core", but
CMake did not find one.

Could not find a package configuration file provided by "Qt5Core" with any
of the following names:

Qt5CoreConfig.cmake
qt5core-config.cmake

Add the installation prefix of "Qt5Core" to CMAKE_PREFIX_PATH or set
"Qt5Core_DIR" to a directory containing one of the above files. If
"Qt5Core" provides a separate development package or SDK, be sure it has
been installed.
Call Stack (most recent call first):
/usr/local/lib/cmake/SoQt-1.6.0/soqt-config.cmake:65 (find_dependency)
CMakeLists.txt:15 (find_package)

CMake Warning at CMakeLists.txt:15 (find_package):
Found package configuration file:

/usr/local/lib/cmake/SoQt-1.6.0/soqt-config.cmake

but it set SoQt_FOUND to FALSE so package "SoQt" is considered to be NOT
FOUND. Reason given by package:

SoQt could not be found because dependency Qt5Core could not be found.

-- Configuring done
-- Generating done
-- Build files have been written to: ~/Downloads/Coin3D/pivy
Then:Python 3.10.6 (main, Nov 14 2022, 16:10:14) [GCC 11.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.

import pivy
Traceback (most recent call last):
File "", line 1, in
File "/usr/lib/python3/dist-packages/pivy/init.py", line 30, in
from .coin import SoDB, SoNodeKit, SoInteraction
File "/usr/lib/python3/dist-packages/pivy/coin.py", line 40333, in
class SoGeo(object):
File "/usr/lib/python3/dist-packages/pivy/coin.py", line 40367, in SoGeo
swig_destroy = _coin.delete_SoGeo
AttributeError: module 'pivy._coin' has no attribute 'delete_SoGeo'

`