ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

how can i change the python path

asked 2020-02-06 03:51:59 -0600

GP202-DAR gravatar image

updated 2022-01-22 16:16:19 -0600

Evgeny gravatar image

so this the whole error but i figured that maybe if i change the python path it will solve the problem but i dont know how i want to change from python 3 to 2.7 i don't know why it is searching in python 3 so can anyone help with the steps since i am new to ubunt 16.04 and ros i just want to change the python path.

 at /opt/ros/kinetic/share/catkin/cmake/safe_execute_process.cmake:11 (message):
  returned error code 1
Call Stack (most recent call first):
  /opt/ros/kinetic/share/catkin/cmake/catkin_package_xml.cmake:74 (safe_execute_process)
  /opt/ros/kinetic/share/catkin/cmake/all.cmake:168 (_catkin_package_xml)
  /opt/ros/kinetic/share/catkin/cmake/catkinConfig.cmake:20 (include)
  CMakeLists.txt:56 (find_package)

-- Configuring incomplete, errors occurred!
See also "/home/evadro/catkin_ws/build/CMakeFiles/CMakeOutput.log".
See also "/home/evadro/catkin_ws/build/CMakeFiles/CMakeError.log".
Invoking "cmake" failed
edit retag flag offensive close merge delete



Is this a duplicate of #q343428?

gvdhoorn gravatar image gvdhoorn  ( 2020-02-06 04:30:10 -0600 )edit

2 Answers

Sort by ยป oldest newest most voted

answered 2020-03-08 15:24:18 -0600

athackst gravatar image

updated 2020-03-08 15:25:57 -0600

I believe I ran into this problem too. Since lsb_release now automatically installs python3 on 16.04, the catkin_make executable sees that it exists and then tries to use it with incomplete dependencies.

I have found 2 solutions to this:

  • Install the required python3 libraries for catkin_make to work

    sudo apt-get install python3-pip python3-yaml

    sudo pip3 install rospkg catkin_pkg



  • Use catkin build tools and specify the python version you want to use for compiling

    sudo apt-get install python-catkin-tools

    catkin build -DPYTHON_VERSION=2.7

edit flag offensive delete link more

answered 2020-02-06 19:31:16 -0600

updated 2020-02-06 19:32:51 -0600

What is the output of python --version in your system ?

list all pythons on your system

ls /usr/bin/python*

and then use alias in ~/.bashrc file to change default python in your system with ;

alias python='/usr/bin/python2.7'

also source ~./bashrc, afteryou added above line

edit flag offensive delete link more


python --version Python 2.7.13 evadro@evadro-PowerEdge-T620:~$ ls /usr/bin/python* /usr/bin/python /usr/bin/python3.5-config /usr/bin/python2 /usr/bin/python3.5m /usr/bin/python2.7 /usr/bin/python3.5m-config /usr/bin/python2.7-config /usr/bin/python3-config /usr/bin/python2-config /usr/bin/python3m /usr/bin/python3 /usr/bin/python3m-config /usr/bin/python3.5 /usr/bin/python-config evadro@evadro-PowerEdge-T620:~$ alias python='/usr/bin/python2.7' evadro@evadro-PowerEdge-T620:~$ source ~./bashrc bash: ~./bashrc: No such file or directory evadro@evadro-PowerEdge-T620:~$ ~/.bashrc /home/evadro/.bashrc: line 8: return: can only `return' from a function or sourced script /home/evadro/.bashrc: line 119: /home/evadro/catkin_ws/devel/setup.bash: No such file or directory /home/evadro/.bashrc: line 124: /home/evadro/catkin_ws/devel/setup.bash: No such file or directory /home/evadro/.bashrc: line 125: /home/evadro/catkin_ws/devel/setup.bash: No

GP202-DAR gravatar image GP202-DAR  ( 2020-02-09 02:12:51 -0600 )edit

this is the output.i think i have problem with bashrc file

GP202-DAR gravatar image GP202-DAR  ( 2020-02-09 02:13:45 -0600 )edit

and another information i build ros from source is it the problem do you think the problem is there

GP202-DAR gravatar image GP202-DAR  ( 2020-02-09 02:19:15 -0600 )edit

Question Tools

1 follower


Asked: 2020-02-06 03:51:59 -0600

Seen: 2,731 times

Last updated: Mar 08 '20