catkin-build时:pkg_resources.DistributionNotFound: The ‘X’ distribution was not found and is required

ubuntu20.04,运行命令     

sudo apt-get install python-catkin-tools
20.04运行:sudo apt-get install python3-catkin-tools

具体自己操作系统用python还是python3可以百度一下,很简单找到答案

正确安装之后,用catkin build编译包时,即运行命令 catkin build 包名

出现以下错误::

pkg_resources.DistributionNotFound: The 'osrf-pycommon>0.1.1' distribution was not found and is required by catkin-tools

解决了后知道,这是因为电脑没有osrf-pycommon这个python包,用pip install osrf-pycommon 命令安装即可,如果电脑没有pip,需要自己运行以下命令安装pip

sudo apt install python-pip
sudo apt install python3-pip(我安装的这个,然后pip install osrf-pycommon,就成功了,大家参考下)

具体安装哪个版本,取决于你电脑的python版本,两者区别大概是这样的:
1、pip是python的包管理工具,pip和pip3版本不同
2、如果系统中只安装了Python2,那么就只能使用pip。
3、如果系统中只安装了Python3,那么既可以使用pip也可以使用pip3,二者是等价的。
4、如果系统中同时安装了Python2和Python3,则pip默认给Python2用,pip3指定给Python3用。
5、重要:虚拟环境中,若只存在一个python版本,可以认为在用系统中pip和pip3命令都是相同的

在解决问题过程中,查看了以下文档(虽然都和该问题解决没有直接关系,但也是自己记录一下,有需求可以自行查看吧):

pip 和pip3区别:https://blog.csdn.net/qq_40584960/article/details/86082019

Ubuntu16.04系统查看已安装的python版本,及Python2与Python3之间切换:https://blog.csdn.net/wangguchao/article/details/82151372

apt 和 apt-get的区别:https://blog.csdn.net/liudsl/article/details/79200134

catkin的使用:https://blog.csdn.net/walkerfan/article/details/89058479

pypi osrf-pycommon主页 :https://pypi.org/project/osrf-pycommon/#files

ROS包创建问题:The 'catkin-pkg==0.4.18' distribution was not found and is required by the application解决方法 :https://blog.csdn.net/java0fu/article/details/106080397

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值