ceres_python_bindings
ceres_python_bindings copied to clipboard
PyCeres.cpython-36m-x86_64-linux-gnu.so: undefined symbol: cholmod_solve
I'm an error when I call 'import PyCeres', and I've built it along side Ceres 2.0.0. Do I need to use a different version of Ceres, or I did something else wrong?
import PyCeres Traceback (most recent call last): File "", line 1, in File "/home/danny/ceres/ceres-venv/lib/python3.6/site-packages/PyCeres/init.py", line 1, in from PyCeres.PyCeres import * ImportError: /home/danny/ceres/ceres-venv/lib/python3.6/site-packages/PyCeres/PyCeres.cpython-36m-x86_64-linux-gnu.so: undefined symbol: cholmod_solve
There are two ways to build this library: way1(Build Alongside Ceres) and way2(Build separately and link to Ceres). If you used way2 , you can try to rebuild this library using way1.
@jingwang960108 Hello, I've installed this library without any errors using the way 2 you mentioned,
but my python script throws the error ModuleNotFoundError: No module named 'PyCeres'
.
I did the same thing as built-with-cmake guide as follows, but Python can't find the PyCeres library. How did you solve this problem?
import sys
pyceres_location="./ceres-solver-2.1.0/build/lib/PyCeres.cpython-37m-x86_64-linux-gnu.so"
sys.path.insert(0, pyceres_location)
print(pyceres_location)
import PyCeres
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'PyCeres'
@zinuok I rebuild this library using way1, then python can find the library.
Oh sorry, I mistakenly wrote the way1 as way2. I built this lib. using the way1 (not way2) with the following process.
- build Ceres-2.1.0 after adding include(ceres_python_bindings/AddToCeres.cmake) according to Recommended: Build Alongside Ceres
- find PyCeres.cpython-[version]m-x86_64-linux-gnu.so: in my case, it was as follows:
"./ceres-solver-2.1.0/build/lib/PyCeres.cpython-37m-x86_64-linux-gnu.so"
- add to sys.path in Python as above, according to built-with-cmake
However, it throws the
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'PyCeres'
Is there any specific thing, I've missed?
Thank you in advance
@zinuok
you can try finding the location of the "PyCeres.cpython-37m-x86_64-linux-gnu.so" and "import PyCeres" directly into the Python terminal without using "sys"
It works fine now! Thank you really
I meet the same problem. Solved by copying PyCeres.so to the working space.
I meet the same problem. I solved this by specifying which directory the file exist in and not the file itself e.g.
pyceres_location="../ceres-bin/lib/"
import sys
sys.path.insert(0, pyceres_location)
import PyCeres
where PyCeres.cpython-37m-x86_64-linux-gnu.so
is in lib
directory