0
$\begingroup$

Rosanswers logo

Hi,

Error (Happened after I fixed the error above and I tried to rosrun tf view_frames)

user@ubuntu:~$ rosrun tf view_frames 
Traceback (most recent call last):
  File "/opt/ros/fuerte/stacks/geometry/tf/scripts/view_frames", line 43, in <module>
    import roslib; roslib.load_manifest(PKG) 
  File "/opt/ros/fuerte/lib/python2.7/dist-packages/roslib/__init__.py", line 50, in <module>
    from roslib.launcher import load_manifest
  File "/opt/ros/fuerte/lib/python2.7/dist-packages/roslib/launcher.py", line 42, in <module>
    import rospkg
ImportError: No module named rospkg

Solution executed: (Make no difference) $sudo apt-get install python-rospkg $sudo apt-get install --reinstall ros-fuerte-ros-comm reinstall python 2.7

user@ubuntu:~$ env | grep ROS
ROS_ROOT=/opt/ros/fuerte/share/ros
ROSLISP_PACKAGE_DIRECTORY=/opt/ros/fuerte/share/common-lisp/ros
ROS_PACKAGE_PATH=/opt/ros/fuerte/share:/opt/ros/fuerte/stacks
ROS_MASTER_URI=http://localhost:11311
ROS_DISTRO=fuerte
ROS_ETC_DIR=/opt/ros/fuerte/etc/ros

PYTHONPATH=/opt/ros/fuerte/lib/python2.7/dist-packages:/opt/ros/fuerte/lib/python2.7/dist-packages:

Please help I can't continue with my work, very much appreciated.


Originally posted by FuerteNewbie on ROS Answers with karma: 123 on 2013-10-01

Post score: 0


Original comments

Comment by tfoote on 2013-10-03:
What is your PYTHON_PATH?

Comment by FuerteNewbie on 2013-10-03:
/opt/ros/fuerte/lib/python2.7/dist-packages:/home/user/usr/lib/pymodules/python2.7/

I just added 'export $PYTHONPATH=/usr/lib/pymodules/python2.7/' that's it looks a little different right now, after I add it into pythonpath now my bad marshall data(string ref out of range) come back again..

Comment by FuerteNewbie on 2013-10-03:
How to set my pythonpath back to default?

Comment by tfoote on 2013-10-03:
If you open a new terminal that will reset your environment back to what's in you ~/.bashrc is there anything in that? Can you share what your env is with 'env | grep ROS && env | grep PY. Please add it as an edit of your question to get good formatting.

Comment by dornhege on 2013-10-04:
What happens if you just open python and type import rospkg?

Comment by Dirk Thomas on 2013-10-05:
What Ubuntu version are you using and what Python version?

Comment by FuerteNewbie on 2013-10-06:
I am using python 2.7, it was functioning well before. Until I edit my roslaunch file someday and trying to roslaunch it and the python seems to be crashed on that time. @dornhege

import rospkg Traceback (most recent call last): File "", line 1, in ImportError: No module named rospkg

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

That's an odd error.

As a random guess your installation is corrupted. I'd suggest trying sudo apt-get install --reinstall ros-fuerte-ros-comm

If you want to debug it you can manually try to reproduce by running the imports manually in a python instance.


Originally posted by tfoote with karma: 58457 on 2013-10-02

This answer was ACCEPTED on the original site

Post score: 0


Original comments

Comment by FuerteNewbie on 2013-10-02:
Reinstall doesn't help. Does reinstalling python will do? How am I gonna do?

Comment by tfoote on 2013-10-02:
From your update that it's failing to import rospkg. Check that you don't have a pip version of rospkg and try reinstalling python-rospkg in the same way as above.

Comment by FuerteNewbie on 2013-10-02:
I have tried sudo apt-get python-rospkg and it doesn't make any different, that's the problem right now.

Comment by FuerteNewbie on 2013-10-02:
Reinstall fuerte still can't fix the problem.

Comment by FuerteNewbie on 2013-10-06:
Bad marshal data fixed after I reboot my computer.

Comment by tgaaly on 2013-12-07:
I have the same problem. I cannot even import rospkg within python. rospkg is not in my /usr/lib/pymodules/python2.7 directory. There are 2 rospkg_loader.* files within the rosdep2 subfolder. Im not sure whats going on but I keep getting the "ImportError: No module named rospkg" when running roscore

$\endgroup$

Your Answer

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