g2opy icon indicating copy to clipboard operation
g2opy copied to clipboard

AttributeError: module 'g2o' has no attribute 'SparseOptimizer'

Open kaixinbear opened this issue 5 years ago • 2 comments

Installing with sudo (I was okay with that since I was using it in a container) seemed to work.

Naturally that would be in the system python. I don't quite understand the issue though? Do some modules under the Cmake file have permission requirements?

Originally posted by @varun19299 in https://github.com/uoip/g2opy/issues/15#issuecomment-450617698

Successfully build,make,install g2o,but I can't use the module although making with sudo. Could someone help me?

kaixinbear avatar Mar 03 '20 12:03 kaixinbear

As discussed here, you need to build for the python version you're using. Remove the build folder and re-run cmake with:

cmake -DPYBIND11_PYTHON_VERSION=3.6 ..
make -j8

Note: don't run any export PYTHON_PATH=PATH-to-g2o/g2o:$PYTHONPATH because the g2o folder is in C++ and not what you want.

minhkhang1795 avatar Mar 05 '20 07:03 minhkhang1795

As discussed here, you need to build for the python version you're using. Remove the build folder and re-run cmake with:

cmake -DPYBIND11_PYTHON_VERSION=3.6 ..
make -j8

Note: don't run any export PYTHON_PATH=PATH-to-g2o/g2o:$PYTHONPATH because the g2o folder is in C++ and not what you want.

Chao ban. Minh build lai roi ma van bi loi a. Ban chi giup minh voi a. Minh cam on.

chungtdnatv avatar Jan 27 '21 02:01 chungtdnatv