rosdep update 最奇怪的错误

rosdep update 报错情况比较多,一般情况是由于被墙了链接不上。一般可以通过修改etc/hosts以及修改延迟时间来解决。

普通报错的解决办法

https://blog.csdn.net/weixin_44684139/article/details/104708387

但有一些奇奇怪怪的报错,在今天遇到了。

解决了一下午,终于搞定。

奇怪的报错内容

报错内容可能有以下几种,均是因为一个原因:
(1)

expected ',' or ']', but got '<stream end>'
  in "<string>", line 5954, column 17:
      gentoo: [dev-p

(2)

expected ',' or ']', but got '<stream end>'

(3)

rosup date ScannerError: while scanning a simple key

(4)

Failed to download target platform data for gbpdistro:

(5)

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.19.0

Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/rosdep2/main.py", line 144, in rosdep_main
    exit_code = _rosdep_main(args)
  File "/usr/lib/python2.7/dist-packages/rosdep2/main.py", line 428, in _rosdep_main
    return _no_args_handler(command, parser, options, args)
  File "/usr/lib/python2.7/dist-packages/rosdep2/main.py", line 437, in _no_args_handler
    return command_handlers[command](options)
  File "/usr/lib/python2.7/dist-packages/rosdep2/main.py", line 649, in command_update
    ros_distro=options.ros_distro)
  File "/usr/lib/python2.7/dist-packages/rosdep2/sources_list.py", line 507, in update_sources_list
    rosdep_data = get_gbprepo_as_rosdep_data(dist_name)
  File "/usr/lib/python2.7/dist-packages/rosdep2/gbpdistro_support.py", line 149, in get_gbprepo_as_rosdep_data
    distro_file = get_release_file(gbpdistro)
  File "/usr/lib/python2.7/dist-packages/rosdep2/rosdistrohelper.py", line 76, in get_release_file
    dist_file = rosdistro.get_distribution_file(get_index(), distro)
  File "/usr/lib/python2.7/dist-packages/rosdistro/__init__.py", line 120, in get_distribution_file
    return create_distribution_file(dist_name, data)
  File "/usr/lib/python2.7/dist-packages/rosdistro/distribution_file.py", line 134, in create_distribution_file
    dist_file = DistributionFile(dist_name, d)
  File "/usr/lib/python2.7/dist-packages/rosdistro/distribution_file.py", line 45, in __init__
    assert 'type' in data, "Expected file type is '%s'" % DistributionFile._type
AssertionError: Expected file type is 'distribution'

原因

etc/hosts文件中的151.101.64.133 raw.githubusercontent.com失效。

解决办法

在网站https://site.ip138.com/raw.githubusercontent.com/中搜索raw.githubusercontent.com,换一个ip重新rosdep update。

我是更换为了151.101.192.133 raw.githubusercontent.com才避免了报错。

  • 2
    点赞
  • 15
    收藏
    觉得还不错? 一键收藏
  • 3
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值