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

python import tf -> rosdep2.core.InvalidData osx-homebrew.yaml

asked 2016-03-17 22:33:38 -0500

lucasw gravatar image

updated 2020-11-21 11:34:52 -0500

I've somehow messed up the ability to import tf:

(starting from a clean .bashrc)

$ source /opt/ros/jade/setup.bash
$ python
Python 2.7.6 (default, Jun 22 2015, 17:58:13) 
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import tf
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/opt/ros/jade/lib/python2.7/dist-packages/tf/", line 29, in <module>
    from listener import TransformListener, TransformerROS
  File "/opt/ros/jade/lib/python2.7/dist-packages/tf/", line 30, in <module>
  File "/opt/ros/jade/lib/python2.7/dist-packages/roslib/", line 62, in load_manifest
    sys.path = _generate_python_path(package_name, _rospack) + sys.path
  File "/opt/ros/jade/lib/python2.7/dist-packages/roslib/", line 93, in _generate_python_path
    m = rospack.get_manifest(pkg)
  File "/usr/lib/python2.7/dist-packages/rospkg/", line 164, in get_manifest
    return self._load_manifest(name)
  File "/usr/lib/python2.7/dist-packages/rospkg/", line 208, in _load_manifest
    retval = self._manifests[name] = parse_manifest_file(self.get_path(name), self._manifest_name, rospack=self)
  File "/usr/lib/python2.7/dist-packages/rospkg/", line 393, in parse_manifest_file
    _static_rosdep_view = init_rospack_interface()
  File "/usr/lib/python2.7/dist-packages/rosdep2/", line 58, in init_rospack_interface
    lookup = _get_default_RosdepLookup(Options())
  File "/usr/lib/python2.7/dist-packages/rosdep2/", line 127, in _get_default_RosdepLookup
  File "/usr/lib/python2.7/dist-packages/rosdep2/", line 607, in create_default
    sources = load_cached_sources_list(sources_cache_dir=sources_cache_dir, verbose=verbose)
  File "/usr/lib/python2.7/dist-packages/rosdep2/", line 508, in load_cached_sources_list
    return parse_sources_data(cache_data, origin=cache_index, model=model)
  File "/usr/lib/python2.7/dist-packages/rosdep2/", line 366, in parse_sources_data
    raise InvalidData("line:\n\t%s\n%s"%(line, e), origin=origin)
rosdep2.core.InvalidData: line:
    yaml osx
unsupported pickle protocol: 4

I cleaned out my ~/.ros/rosdep and ran rosdep update on it, but no change.

Another user account on same system was able to import tf fine, but then I ran rosdep update in it and now it has the same error.

If I scp the sources.cache from another system that hasn't been rosdep updated I can make it work again.

Ubuntu 14.04.4, jade, rosdep 0.11.4-1.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2016-03-18 08:08:53 -0500

lucasw gravatar image

updated 2016-03-18 08:38:24 -0500

The 'import tf' was a distraction that delayed finding this issue which is about python 3 pickle incompatibility with python 2:

And my rosdep does have #!/usr/bin/python3 in it and is in /usr/local/bin (but on two other systems it just has a #!/usr/bin/python and is only in /usr/bin/rosdep, reports the same version). There is also a /usr/bin/rosdep but the local bin takes precedence.

This answer shows how to remove the wrong rosdep:

sudo pip uninstall rosdep
Not uninstalling rosdep at /usr/lib/python2.7/dist-packages, owned by OS

Therefore it was installed by easy_install, and has to be removed by hand. There were a lot of ros files in /usr/local/bin (rosversion, roslocate, rosinstall, rosdistro, rosco), I'll remove all of them:

sudo rm /usr/local/bin/ros*
sudo rm /usr/local/bin/catkin*
sudo rm -rf /usr/local/lib/python3.4/dist-packages/ros*
sudo rm -rf /usr/local/lib/python3.4/dist-packages/catkin_pkg

I'm not sure where they came from, they were all dated December 2nd, and I must not have run rosdep update since then until yesterday.

edit flag offensive delete link more

Question Tools



Asked: 2016-03-17 22:33:38 -0500

Seen: 586 times

Last updated: Mar 18 '16