uoip / g2opy

Python binding of SLAM graph optimization framework g2o
668 stars 176 forks source link

fatal error: Python.h: No such file or directory #36

Closed ankuku closed 4 years ago

ankuku commented 4 years ago

fatal error: Python.h: No such file or directory compilation terminated. python/CMakeFiles/g2o.dir/build.make:62: recipe for target 'python/CMakeFiles/g2o.dir/g2o.cpp.o' failed make[2]: *** [python/CMakeFiles/g2o.dir/g2o.cpp.o] Error 1 CMakeFiles/Makefile2:1577: recipe for target 'python/CMakeFiles/g2o.dir/all' failed make[1]: *** [python/CMakeFiles/g2o.dir/all] Error 2 Makefile:127: recipe for target 'all' failed make: *** [all] Error 2

If this error occurs at some point, most likely you do not have installed python3-dev. Install using sudo apt install python3-dev and it should work.

markfilan commented 2 years ago

Python.h is used by GNU Compiler Collection (gcc) to build applications. You need to install a package called python-dev for building Python modules, extending the Python interpreter or embedding Python in applications. You encounter "Python.h: No such file or directory" error while trying to build a shared library using the file extension of another language ( e.g. 'C' ). If you are trying to build a shared library using the file extension of another language, you need to install the correct development version of Python.

Reason for this error:

How to solve this error: