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

kinetic python3 turtlebot

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

goupil35000 gravatar image

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

joq gravatar image

Hi,

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 ?

Thanks.


  File "/opt/ros/kinetic/share/xacro/xacro.py", line 55, in <module>
    import xacro
  File "/opt/ros/kinetic/lib/python2.7/dist-packages/xacro/__init__.py", line 35, in <module>
    import glob
  File "/home/util1/anaconda3/lib/python3.5/glob.py", 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/xacro.py '/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

Comments

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

joq gravatar image joq  ( 2017-02-15 10:00:39 -0600 )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 -0600 )edit

Hi,

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,

Goupil

goupil35000 gravatar image goupil35000  ( 2017-02-16 10:40:59 -0600 )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 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
0

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

joq gravatar image

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

This answer explains how to use Python3 with ROS.

http://answers.ros.org/question/23761...

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

Question Tools

1 follower

Stats

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

Seen: 1,812 times

Last updated: Apr 02 '17