Comments (10)
For those having the same problem, first don't run any export PYTHON_PATH=PATH-to-g2o/g2o:$PYTHONPATH
because the g2o
folder is written in C++ and not what you want.
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
which will create g2o.cpython-36m-x86_64-linux-gnu.so
in the /lib folder (instead of 37m
). Finally, make sure that there is only one g2o*.so
file in the /lib folder before running python setup.
from g2opy.
@minhkhang1795 @varun19299 @EnriqueSolarte
This is due to the fact the External/pybind11/CMakeLists.txt computed wrong version of python.
After some modification you can get correction python library with correct extension name:
yiakwy@yiakwy ~/WorkSpace/Github/g2opy/build master ●
cmake ..
-- Compiling on Unix
-- Found CHOLMOD and its dependencies
-- Building LGPL code as static library (affects license of the binary)
-- Compiling with OpenGL support
-- Could NOT find QGLVIEWER (missing: QGLVIEWER_INCLUDE_DIR QGLVIEWER_LIBRARY)
-- Compiling with GCC
-- pybind11 PYTHON_INCLUDE_DIR: /home/yiakwy/anaconda3/envs/py36/include/python3.6m
-- pybind11 PYTHON_LIBRARY: /home/yiakwy/anaconda3/envs/py36/lib/libpython3.6m.so.1.0
-- PYTHON_MODULE_PREFIX: /home/yiakwy/anaconda3/envs/py36
-- PYTHON_MODULE_EXTENSION: .cpython-36m-x86_64-linux-gnu.so
-- pybind11 v2.2.1
-- Configuring done
-- Generating done
-- Build files have been written to: /home/yiakwy/WorkSpace/Github/g2opy/build
...
[ 99%] Linking CXX shared module ../../lib/g2o.cpython-36m-x86_64-linux-gnu.so
...
[100%] Built target g2o
Pybind11 will generate correct library for corresponding python executables. Using sudo is prohibited because it will use system installed python which will creates global conflicts later.
@minhkhang1795 @uoip I have to see scripts of External/pybind11/CMakeLists.txt only to find that they are messed up the real python package used in the project.
The author wanted to use "PYTHON_BUILD_MODULE" but it actually sets to "" and moreover, setting these variables in "External/pybind11/CMakeLists.txt" in child scope makes no effects on "python/CMakeLists.txt" .
These two mistakes lead to wrong configuration for python!
from g2opy.
The same question as yours, did you find any solutions?
from g2opy.
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?
from g2opy.
hi everybody,
@Haotian-Zhang. did you solve this issue? I am still on error.
AttributeError: module 'g2o' has no attribute 'BlockSolverSE3'
from g2opy.
I solved my problem.
I was trying to install on python 3.6... it doesn't work. I installed on python 3.5.2
I installed in the default python3 of UBUNTU 16.04.
python3 setup.py install
I also created a conda env.
conda create -n g2o_env python=3.5.2
conda activate g2o_env
conda python setup.py install
Remember that setup.py script is under the directory project....
from g2opy.
Installing g2opy
under sudo
worked for me.
from g2opy.
Yeah but that isn't a recommended way
from g2opy.
For some reason, g2opy is creating a python3.7 library. If I create a virtualenv with python3.7, I am able to use it. The generated so file is called g2o.cpython-37m-x86_64-linux-gnu.so
. How do I force g2opy to compile with 3.6 or any arbitrary python version?
(Also, renaming g2o.cpython-37m-x86_64-linux-gnu.so
to g2o.cpython-36m-x86_64-linux-gnu.so
gives an import error for the version mismatch)
from g2opy.
I install g2opy with sudo ,but it doesn't work either...
from g2opy.
Related Issues (20)
- Error in installing on ubuntu 20.04 HOT 5
- Provide range for a variable to be optimized
- Hiii HOT 1
- Usage
- in descriptor.py
- python3.7 + eigen3.3.1 + gcc 4.8.5 is ok
- make -j8 failed HOT 1
- I met this problem when run python setup.py install HOT 5
- Photometric BA HOT 1
- make[99%] error && void declareXXXX(py::module & m) {^} HOT 2
- ImportError: cannot import name 'AngleAxis' from 'g2o' HOT 1
- python setup.py install assertion error HOT 1
- make: *** [Makefile:130: all] Error 2 HOT 3
- Installation: libsuitesparse-dev is not Optional, but rather required
- window pycharm g2opy HOT 1
- How can I define a new g2o vertex or edge HOT 1
- PGO with unknown translation magnitude
- optimize.save("text.g2o") not working
- Hello, why can’t I get optimized results? Can you help me improve the code? HOT 1
- windows install error
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from g2opy.