How to install ROS2 for Python 3.7 in Ubuntu

asked 2020-04-24 03:15:25 -0600

RDaneelOlivaw gravatar image

Hi,

I've been trying to find soewhere where it explaines how to install ROS2 latest version for python 3.7. Because Eloquent at least is compiled for python 3.6.

Is there anyway to install it with debs for python 3.7? If not, whats the procedure to successfully install it through source compilation, because I'm getting the following error when compiling from source for python 3.7:

export ROS_PYTHON_VERSION=3.7

cd ~/ros2_crystal/
# On Ubuntu Linux Bionic Beaver 18.04
colcon build --symlink-install

ERRORS:

CMake Error at /usr/share/cmake-3.10/Modules/FindPackageHandleStandardArgs.cmake:137 (message): Could NOT find PythonLibs (missing: PYTHON_LIBRARIES PYTHON_INCLUDE_DIRS) (Required is at least version "3.7") Call Stack (most recent call first):
/usr/share/cmake-3.10/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE)
/usr/share/cmake-3.10/Modules/FindPythonLibs.cmake:262 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
src/qt_gui_cpp/CMakeLists.txt:2 (find_package)

I've tried also indicating explicitly the paths:

sudo apt install -y libpython3.7-dev


export PYTHON3_EXECUTABLE=/usr/bin/python3.7
export PYTHON3_INCLUDE_DIR=/usr/include/python3.7m
export PYTHON3_LIBRARY=/usr/lib/x86_64-linux-gnu/libpython3.7m.so
export PYTHON3_NUMPY_INCLUDE_DIRS=/usr/lib/python3/dist-packages/numpy/core/include
export PYTHON3_PACKAGES_PATH=/usr/lib/python3/dist-packages

Traceback (most recent call last):
File "/home/finn/ros2_crystal/install/python_qt_binding/share/python_qt_binding/cmake/sip_configure.py", line 8, in <module> from PyQt5 import QtCore ImportError: cannot import name 'QtCore' from 'PyQt5' (/usr/lib/python3/dist-packages/PyQt5/__init__.py) make[2]: * [sip/qt_gui_cpp_sip/Makefile] Error 1 make[1]: [src/qt_gui_cpp_sip/CMakeFiles/libqt_gui_cpp_sip.dir/all] Error 2 make: ** [all] Error 2

Any idea?

edit retag flag offensive close merge delete

Comments

duplicate of #q350456

mgruhler gravatar image mgruhler  ( 2020-04-24 03:33:34 -0600 )edit

That #q350456 has been close by duplicate by @gvdhoorn of this one... So which one is the one I have to check?!

RDaneelOlivaw gravatar image RDaneelOlivaw  ( 2020-04-25 01:09:16 -0600 )edit
1

This was just a race condition. No need to stress out.

The one that's still open is the one you can continue with.

gvdhoorn gravatar image gvdhoorn  ( 2020-04-25 04:37:31 -0600 )edit

Is this still an issue? If no, can you provide the solution for others and mark it as an answer?

kak13 gravatar image kak13  ( 2021-08-19 12:02:35 -0600 )edit