之前安装的ROS是Fuerte版本的,好久没有更新,不知不觉又出来了好几个新的版本,今天删除了Fuerte,计划安装Hydro版本的尝尝新,按照官网的安装流程,很快就可以把新版本安装上去了,但是在“rosdep update”这一步却总是报错:

reading in sources list data from /etc/ros/rosdep/sources.list.d
Hit https://github.com/ros/rosdistro/raw/master/rosdep/osx-homebrew.yaml
Hit https://github.com/ros/rosdistro/raw/master/rosdep/base.yaml
Hit https://github.com/ros/rosdistro/raw/master/rosdep/python.yaml
Hit https://github.com/ros/rosdistro/raw/master/rosdep/ruby.yaml
Hit https://github.com/ros/rosdistro/raw/master/releases/fuerte.yaml
Query rosdistro index https://raw.github.com/ros/rosdistro/master/index.yaml

ERROR: Rosdep experienced an error: Unable to handle 'index' format version '2', please update rosdistro
Please go to the rosdep page [1] and file a bug report with the stack trace below.
[1] : http://www.ros.org/wiki/rosdep

rosdep version: 0.10.25

Traceback (most recent call last):
  File "/usr/lib/pymodules/python2.7/rosdep2/main.py", line 121, in rosdep_main
    exit_code = _rosdep_main(args)
  File "/usr/lib/pymodules/python2.7/rosdep2/main.py", line 264, in _rosdep_main
    return _no_args_handler(command, parser, options, args)
  File "/usr/lib/pymodules/python2.7/rosdep2/main.py", line 272, in _no_args_handler
    return command_handlers[command](options)
  File "/usr/lib/pymodules/python2.7/rosdep2/main.py", line 437, in command_update
    error_handler=update_error_handler)
  File "/usr/lib/pymodules/python2.7/rosdep2/sources_list.py", line 433, in update_sources_list
    for d, dist in get_index().distributions.items():
  File "/usr/lib/pymodules/python2.7/rosdep2/rosdistrohelper.py", line 69, in get_index
    _RDCache.index = rosdistro.get_index(_RDCache.index_url)
  File "/usr/local/lib/python2.7/dist-packages/rosdistro/__init__.py", line 106, in get_index
    return Index(data, base_url)
  File "/usr/local/lib/python2.7/dist-packages/rosdistro/index.py", line 51, in __init__
    assert int(data['version']) == 1, "Unable to handle '%s' format version '%d', please update rosdistro" % (Index._type, int(data['version']))
AssertionError: Unable to handle 'index' format version '2', please update rosdistro

从网上搜索了错误信息,在论坛里有一种解决办法,见:http://answers.ros.org/question/122266/how-can-i-fix-unable-to-handle-index-format-version-2-please-update-rosdistro/

根据网上找到的办法,rosdistro无法更新,依然解决不了问题,所以考虑可不可以直接通过编译好的包来安装rosdistro,从网上找到0.3.4版本,见https://pypi.python.org/pypi/rosdistro

下载压缩包,解压,进入目录,输入“  sudo python setup.py install ”, 再重新尝试“rosdep update”,问题解决,不会再报error。

----------------------------------------------------------------

欢迎大家转载我的文章。

转载请注明:转自古-月

http://blog.csdn.net/hcx25909

欢迎继续关注我的博客

04-15 05:16