From b281c9baaee24b871fdb2492e635342f9171196f Mon Sep 17 00:00:00 2001 From: Julian Oes Date: Mon, 26 Aug 2019 14:58:42 +0200 Subject: [PATCH] Use Python 3 everywhere Since Python 2 is retired in 4 months, we should move everything to 3. --- CMakeLists.txt | 2 +- cmake/px4_find_python_module.cmake | 8 ++++---- msg/tools/px_generate_uorb_topic_files.py | 6 +++--- .../geometries/tools/px_generate_mixers.py | 4 ++-- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6d70a4577a55..9900dc51dd76 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -266,7 +266,7 @@ endif() # python include(px4_find_python_module) -find_package(PythonInterp REQUIRED) +find_package(PythonInterp 3 REQUIRED) option(PYTHON_COVERAGE "Python code coverage" OFF) if(PYTHON_COVERAGE) diff --git a/cmake/px4_find_python_module.cmake b/cmake/px4_find_python_module.cmake index 55155e2d9a99..3a71f92fda07 100644 --- a/cmake/px4_find_python_module.cmake +++ b/cmake/px4_find_python_module.cmake @@ -65,12 +65,12 @@ function(px4_find_python_module module) endif() endif() find_package_handle_standard_args(PY_${module} - "couldn't find python module ${module}: + "couldn't find python3 module ${module}: \nfor debian systems try: \ - \n\tsudo apt-get install python-${module} \ + \n\tsudo apt-get install python3-${module} \ \nor for all other OSs/debian: \ - \n\tsudo -H pip install ${module}\n" PY_${module_upper}) + \n\tsudo -H pip3 install ${module}\n" PY_${module_upper}) #if (NOT PY_${module}_FOUND) - #message(FATAL_ERROR "python module not found, exiting") + #message(FATAL_ERROR "python3 module not found, exiting") #endif() endfunction(px4_find_python_module) diff --git a/msg/tools/px_generate_uorb_topic_files.py b/msg/tools/px_generate_uorb_topic_files.py index 02c076bccefc..dd208220d504 100755 --- a/msg/tools/px_generate_uorb_topic_files.py +++ b/msg/tools/px_generate_uorb_topic_files.py @@ -55,11 +55,11 @@ On a Debian/Ubuntu system please run: - sudo apt-get install python-empy - sudo pip install catkin_pkg + sudo apt-get install python3-empy + sudo pip3 install catkin_pkg On MacOS please run: - sudo pip install empy catkin_pkg + sudo pip3 install empy catkin_pkg On Windows please run: easy_install empy catkin_pkg diff --git a/src/lib/mixer/MultirotorMixer/geometries/tools/px_generate_mixers.py b/src/lib/mixer/MultirotorMixer/geometries/tools/px_generate_mixers.py index 937f0f4d5551..a0d3c1b222bc 100755 --- a/src/lib/mixer/MultirotorMixer/geometries/tools/px_generate_mixers.py +++ b/src/lib/mixer/MultirotorMixer/geometries/tools/px_generate_mixers.py @@ -44,10 +44,10 @@ except ImportError as e: print("python import error: ", e) print(''' -Required python packages not installed. +Required python3 packages not installed. On a GNU/Linux or MacOS system please run: - sudo pip install numpy toml + sudo pip3 install numpy toml On Windows please run: easy_install numpy toml