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

Cannot run roscore, rosmake with python 3

asked 2011-04-20 22:17:36 -0500

Tien Thanh gravatar image

updated 2011-04-21 14:48:07 -0500

joq gravatar image

Hi all,

I got SyntaxError when run roscore, rosmake, rosversion ...

tienthanh@tienthanh-pc:~$ roscore
Traceback (most recent call last):
 File "/opt/ros/diamondback/ros/bin/roscore", line 34, in <module>
    from ros import roslaunch
  File "/opt/ros/diamondback/ros/core/roslib/src/ros/__init__.py", line 55
    except roslib.packages.InvalidROSPkgException, e:
                                                 ^
SyntaxError: invalid syntax

tienthanh@tienthanh-pc:~$ roscd rgbdslam && rosmake --rosdep-install rgbdslam
  File "/opt/ros/diamondback/ros/bin/rosmake", line 46
    print "Rospack failed to build" 
                                  ^
tienthanh@tienthanh-pc:/opt/ros/diamondback/stacks/rgbdslam$ rosversion
  File "/opt/ros/diamondback/ros/bin/rosversion", line 55
    except Exception, e:
                    ^
SyntaxError: invalid syntax
edit retag flag offensive close merge delete

Comments

Which version of python are you running?
Ugo gravatar image Ugo  ( 2011-04-20 22:24:22 -0500 )edit
python --version Python 3.1.2
Tien Thanh gravatar image Tien Thanh  ( 2011-04-21 00:16:34 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2011-04-21 00:22:20 -0500

Ugo gravatar image

For python 3 support, you should have a look at this ticket: https://code.ros.org/trac/ros/ticket/3166

But I think you're going to have some trouble getting ROS to work on python 3. Can't you use python2 instead? Or are you running Arch Linux?

Cheers,

Ugo

edit flag offensive delete link more

Comments

I use Ubuntu 10.04, I tried to change the python default version to 2.6 with sudo ln -s /usr/bin/python-config2.6 /usr/bin/python-config and sudo ln -s /usr/bin/python2.6 /usr/bin/python. But it's not work. I also tried with update-alternatives, but that no help. How to change back to python2.6?
Tien Thanh gravatar image Tien Thanh  ( 2011-04-21 01:07:23 -0500 )edit
You ran update-alternatives and selected python 2.6? What does python --version return?
Ugo gravatar image Ugo  ( 2011-04-21 01:38:55 -0500 )edit
Python 3.1.2
Tien Thanh gravatar image Tien Thanh  ( 2011-04-21 02:06:10 -0500 )edit
and ls -l /usr/bin/python is linked to /usr/bin/python2.6? How did you install python3? Through apt-get?
Ugo gravatar image Ugo  ( 2011-04-21 02:12:36 -0500 )edit
Yes the ln -s /usr/bin/python is linked to /usr/bin/python2.6. I installed python3 through robotpkg http://softs.laas.fr/openrobots/robotpkg/README.html#tth_sEc2.1.3.
Tien Thanh gravatar image Tien Thanh  ( 2011-04-21 02:28:38 -0500 )edit
Then you should probably have a look at your PATH and see where python 3 is installed (may be /usr/local/bin?). If you do export PATH=/usr/bin and check python --version it should give you python 2.6.
Ugo gravatar image Ugo  ( 2011-04-21 02:34:42 -0500 )edit
I change the link in python in robotpkg to /usr/bin/python2.6 and it works. But I'm not sure package in robotpkg still work probaly. Thank you anyways.
Tien Thanh gravatar image Tien Thanh  ( 2011-04-21 03:07:26 -0500 )edit

Question Tools

Stats

Asked: 2011-04-20 22:17:36 -0500

Seen: 1,587 times

Last updated: Apr 21 '11