ceres_python_bindings icon indicating copy to clipboard operation
ceres_python_bindings copied to clipboard

PyCeres.cpython-36m-x86_64-linux-gnu.so: undefined symbol: cholmod_solve

Open danny-kh opened this issue 2 years ago • 8 comments

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

danny-kh avatar Jun 27 '22 10:06 danny-kh

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 avatar Jun 28 '22 02:06 jingwang960108

@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 avatar Aug 05 '22 07:08 zinuok

@zinuok I rebuild this library using way1, then python can find the library.

jingwang960108 avatar Aug 05 '22 07:08 jingwang960108

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"

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 avatar Aug 05 '22 10:08 zinuok

@zinuok Screenshot from 2022-08-05 20-11-33 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"

jingwang960108 avatar Aug 05 '22 12:08 jingwang960108

It works fine now! Thank you really

zinuok avatar Aug 05 '22 15:08 zinuok

I meet the same problem. Solved by copying PyCeres.so to the working space.

kwwcv avatar Sep 06 '22 12:09 kwwcv

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

joshuadkitenge avatar Oct 13 '22 09:10 joshuadkitenge