栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Python

rosdep update错误失败一直timeout解决方法

Python 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

rosdep update错误失败一直timeout解决方法

更新rosdep

终端输入

rosdep update
失败1.The read operation timed out(包括ERROR: unable to process source,ERROR: error loading sources list:
) 原因都是外网网址访问不稳定(可多尝试几次rosdep update
)


 多次尝试依然报错可尝试下面的解决方法

解决办法
第一步.把相关文件下载到本地:(注意:下面代码中nice换为你的用户名)
 
git clone https://github.com/ros/rosdistro.git /home/nice/robot

如网络不好无法Git下载可以在下面我分享的百度网盘链接下载压缩包然后解压提取到主目录下

链接:https://pan.baidu.com/s/1ZjMcvqOvLRa_iTdXis8ufg 
提取码:01e2
第二步.改去rosdep update获取文件的网址换为本地地址: 

终端输入(注意:下面代码以Ubuntu20.04为例,18.04将下面代码中python3改为python2.7即可)

sudo gedit /usr/lib/python3/dist-packages/rosdep2/rep3.py

输入后回车会弹出rep3.py文件将原来文件中的 REP3_TARGETS_URL = 'https://raw.githubusercontent.com/ros/rosdistro/master/releases/targets.yaml' 替换成 REP3_TARGETS_URL = 'file:///home/nice/robot/releases/targets.yaml'(此处nice改为你的用户名因为此处的具体地址为你下载到本地的文件的地址。)

 Ctrl+S保存并退出

终端输入(注意:下面代码以Ubuntu20.04为例,18.04将下面代码中python3改为python2.7即可)
 

sudo gedit /etc/ros/rosdep/sources.list.d/20-default.list

输入回车后会弹出20-default.list文件将原来文件中的所有 raw.githubusercontent.com开头的网址替换成对应文件在本地的路径(可将下面代码更换20-default.list中的代码注意:代码中的nice全部更换为你的用户名)

# os-specific listings first
yaml file:///home/nice/robot/rosdep/osx-homebrew.yaml osx
 
# generic
yaml file:///home/nice/robot/rosdep/base.yaml
yaml file:///home/nice/robot/rosdep/python.yaml
yaml file:///home/nice/robot/rosdep/ruby.yaml
gbpdistro file:///home/nice/robot/releases/fuerte.yaml fuerte
 
# newer distributions (Groovy, Hydro, ...) must not be listed anymore, they are being fetched from the rosdistro index.yaml instead

修改为如下图后保存退出(注意:代码中的nice全部更换为你的用户名)

 

然后再次rosdep update一般99%几率成功,如果不成功可评论或私信我

rosdep update成功 

 

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/755440.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号