0
$\begingroup$

Rosanswers logo

I have Indigo ROS and Ubuntu 14.04.5 LTS. Few month ago when I run rosrun tf view_frames, it worked, but now it gives me a SyntaxError (as seen in the picture). I can't fix the syntax, because I don't have a permission to change files inside ros folder.

Is there any solution to this problem?

ubuntu@ubuntu-MS-7817:~$ rosrun tf view_frames 
  File "/opt/ros/indigo/lib/tf/view_frames", line 57
    print "Listening to /tf for %f seconds"%duration
                                          ^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(int "Listening to /tf for %f seconds"%duration)?

Originally posted by Kri on ROS Answers with karma: 41 on 2018-02-28

Post score: 0


Original comments

Comment by gvdhoorn on 2018-02-28:
I just let your post out of the moderation queue, but if I would apply the support guidelines strictly, I should immediately close it. Was:

Please DO NOT post a screenshot of the terminal or source file.

Not clear enough?

Comment by gvdhoorn on 2018-02-28:
As to your issue: have you installed Anaconda or Python 3 between now and "few months ago"? If so, it could be that python3 is now the default interpreter, and view_frames has not been made Python 3 compatible yet, leading to the syntax error.

Comment by Kri on 2018-03-01:
@gvdhoorn I'm sorry, I didn't see the guidelines before. Luckily my issue isn't of that sort that would require copying the error to find out what is wrong.

Comment by Kri on 2018-03-01:
@gvdhoorn I don't remember doing anything with python ever on this computer, but my roommates might. I wouldn't know. Is there a way how to change the default python interpreter version?

Comment by gvdhoorn on 2018-03-01:\

I didn't see the guidelines before

they were shown to you almost fullscreen when you created your post.

my issue isn't of that sort that would require copying the error to find out what is wrong

I'd still like you to replace the image with the copy-pasted text of the error.

Comment by Kri on 2018-03-01:
@gvdhoorn I have edited the question. Is this done right?

Comment by gvdhoorn on 2018-03-01:
That's great. Thanks.

As to your problem: what is the output of python --version?

Comment by simff on 2018-03-01:
An alternative way to view tf frames is: rosrun rqt_tf_tree rqt_tf_tree. This requires to have this into your workspace :)

Comment by gvdhoorn on 2018-03-01:
That would be a possible work-around yes, but it might be better to get to the bottom of this so we can make sure it's not an issue with the packages.

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

@gvdhoorn it used to output 'python3' I have changed it into 'python2,' but the error remained. I used a command which python to see the path and discovered it leads to python2 inside miniconda3 folder. I have deleted the miniconda3 folder and now it works. Thank you for your patience and help.


Originally posted by Kri with karma: 41 on 2018-03-01

This answer was ACCEPTED on the original site

Post score: 0


Original comments

Comment by gvdhoorn on 2018-03-01:
Let's make this the answer. I would still it if you could check whether you are up-to-date, as the exact problem you are reporting should have been fixed (on 2017-07-24 already).

Comment by gvdhoorn on 2018-03-01:
@Kri: afaict, ros/geometry#151 should have resolved some lingering python2/3 issues with tf, even on Indigo. Can you make sure you're up-to-date?

Comment by Kri on 2018-03-01:
@gvdhoorn I don't know how to do that. I don't even understand what that means, which makes it hard to search for.

Comment by gvdhoorn on 2018-03-01:
When was the last time you did an sudo apt-get update and sudo apt-get upgrade, or used the Ubuntu Software Centre to update your ROS packages (assuming you use Ubuntu)?

Comment by gvdhoorn on 2018-03-01:
Note that I'm not saying you should upgrade now. I just want to figure out why you're running into this issue which should have already been fixed quite some time ago.

Comment by Kri on 2018-03-01:
That might me problematic. I did that few days ago, but since then the updated ubuntu doesn't get pass login screen (update broke something). Therefor I have to chose older version of ubuntu from GRUB. I don't know what else is not up to date when I run on the older version.

Comment by gvdhoorn on 2018-03-01:
Ok. Let's just chalk this up to using an unsupported Python version for now, and assume it has been fixed in recent versions of tf.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.