ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A
Ask Your Question

kinetic python3 turtlebot

asked 2017-02-13 10:44:25 -0500

goupil35000 gravatar image

updated 2017-02-15 09:58:09 -0500

joq gravatar image


I need to work with python3 for some works, so I install anaconda3 in my home directory and put in ~/.bashrc the line: export PATH="/home/util1/anaconda3/bin:$PATH" No problem with this, it works.

But when I want to use package turtlebot with the command "roslaunch turtlebot_bringup minimal.launch", I have the following message. As you can see it uses python 2.7 under ros kinetic and also go to find some things in anaconda3 python3.5.

Any idea to deal with this ? Is-it possible to use another version of python with kinectic and turtlebot ?


  File "/opt/ros/kinetic/share/xacro/", line 55, in <module>
    import xacro
  File "/opt/ros/kinetic/lib/python2.7/dist-packages/xacro/", line 35, in <module>
    import glob
  File "/home/util1/anaconda3/lib/python3.5/", line 4, in <module>
    import re
ImportError: No module named 're'
while processing /opt/ros/kinetic/share/turtlebot_bringup/launch/includes/robot.launch.xml:
while processing /opt/ros/kinetic/share/turtlebot_bringup/launch/includes/description.launch.xml:
Invalid <param> tag: Cannot load command parameter [robot_description]: command [/opt/ros/kinetic/share/xacro/ '/opt/ros/kinetic/share/turtlebot_description/robots/kobuki_hexagons_kinect.urdf.xacro'] returned with code [1]. 
Param xml is <param command="$(arg urdf_file)" name="robot_description"/>
The traceback for the exception was written to the log file
edit retag flag offensive close merge delete


Your call stack seems to be mixing python 2 and python 3 versions.

joq gravatar image joq  ( 2017-02-15 10:00:39 -0500 )edit

seems like a conflict between anaconda and ros. Comment the bash line that include anaconda in the PATH environment and try again.

agbj gravatar image agbj  ( 2017-02-15 12:03:42 -0500 )edit


Thanks for answers. I understand it's a problem mixing python 2 and 3. When I remove the line in my ~/.bashrc, it works.

My question was: how to deal with this, and if possible using python 3 with ROS.

Have a nice day,


goupil35000 gravatar image goupil35000  ( 2017-02-16 10:40:59 -0500 )edit

I never mixed python 3 with ROS but do you tried to install python3 through the repositories and not through anaconda?

agbj gravatar image agbj  ( 2017-04-01 09:44:22 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2017-04-02 13:57:01 -0500

joq gravatar image

updated 2017-04-02 13:57:43 -0500

This answer explains how to use Python3 with ROS.

It's not simple. You have to build everything from source and install the python3 versions of all the dependencies.

edit flag offensive delete link more

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


Asked: 2017-02-13 10:44:25 -0500

Seen: 1,188 times

Last updated: Apr 02 '17