[ROS2 Foxy] SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip

thomas@thomas-virtual-machine:~/dev_ws$ colcon build
Starting >>> learning_interface
Starting >>> learning_cv                          
--- stderr: learning_cv                                                                  
/usr/lib/python3/dist-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
  warnings.warn(
---
Finished <<< learning_cv [1.96s]
Starting >>> learning_gazebo
--- stderr: learning_gazebo                                                                  
/usr/lib/python3/dist-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
  warnings.warn(
 

============

参考:

玩转ROS2的填坑之路-SetuptoolsDeprecationWarning: setup.py install is deprecated

解决方法——降档使用setuptools

构建程序时使用setup.py的方法已被弃用。该问题目前尚未解决

有个折中的处理方式。

换一个setuptools版本,选择与ROS2一起工作不产生任何warning的版本。

能满足这个条件的setuptools版本中,最新的是58.2.0。

$ sudo apt install python3-pip

$ pip install setuptools==58.2.0

在调用 colcon build 编译就通过了

赠品:如何查询setuptools的版本

thomas@thomas-virtual-machine:~/dev_ws$ python3
Python 3.10.12 (main, Nov 20 2023, 15:14:05) [GCC 11.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import setuptools
>>> print(setuptools.__version__)
59.6.0
>>> quit()
thomas@thomas-virtual-machine:~/dev_ws$ 
 

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值