Ask Your Question
0

how can i change the python path

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

GP202-DAR gravatar image

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

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):
  execute_process(/usr/bin/python3
  "/opt/ros/kinetic/share/catkin/cmake/parse_package_xml.py"
  "/opt/ros/kinetic/share/catkin/cmake/../package.xml"
  "/home/evadro/catkin_ws/build/catkin/catkin_generated/version/package.cmake")
  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

Comments

1

Is this a duplicate of #q343428?

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

2 Answers

Sort by ยป oldest newest most voted
1

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

athackst gravatar image

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

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

    catkin_make

OR

  • 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
0

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

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

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

Comments

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 -0500 )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 -0500 )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 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

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

Seen: 1,913 times

Last updated: Mar 08 '20