Coder Social home page Coder Social logo

Only private modules found about g2opy HOT 10 OPEN

varun19299 avatar varun19299 commented on May 20, 2024 2
Only private modules found

from g2opy.

Comments (10)

minhkhang1795 avatar minhkhang1795 commented on May 20, 2024 8

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.

yiakwy-enterprise-roborock avatar yiakwy-enterprise-roborock commented on May 20, 2024 3

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

Haotian-Zhang avatar Haotian-Zhang commented on May 20, 2024

The same question as yours, did you find any solutions?

from g2opy.

varun19299 avatar varun19299 commented on May 20, 2024

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.

EnriqueSolarte avatar EnriqueSolarte commented on May 20, 2024

hi everybody,
@Haotian-Zhang. did you solve this issue? I am still on error.

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

from g2opy.

EnriqueSolarte avatar EnriqueSolarte commented on May 20, 2024

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.

shakhrayv avatar shakhrayv commented on May 20, 2024

Installing g2opy under sudo worked for me.

from g2opy.

varun19299 avatar varun19299 commented on May 20, 2024

Yeah but that isn't a recommended way

from g2opy.

medakk avatar medakk commented on May 20, 2024

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.

kaixinbear avatar kaixinbear commented on May 20, 2024

I install g2opy with sudo ,but it doesn't work either...

from g2opy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.