Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
danny-kh opened this issue Jun 27, 2022 · 8 comments
Open

Comments

@danny-kh
Copy link

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

@jingwang960108
Copy link

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.

@zinuok
Copy link

zinuok commented Aug 5, 2022

@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'

@jingwang960108
Copy link

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

@zinuok
Copy link

zinuok commented Aug 5, 2022

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

@jingwang960108
Copy link

@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"

@zinuok
Copy link

zinuok commented Aug 5, 2022

It works fine now!
Thank you really

@kwwcv
Copy link

kwwcv commented Sep 6, 2022

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

@joshuadkitenge
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants