colcon build报错
-
Starting >>> learning_interface
Starting >>> learning_cv
Starting >>> learning_gazebo
Starting >>> learning_gazebo_harmonic
Starting >>> learning_launch
Starting >>> learning_node
Starting >>> learning_node_cpp
Starting >>> learning_parameter
/home/cat/.local/lib/python3.10/site-packages/setuptools/_distutils/dist.py:270: UserWarning: Unknown distribution option: 'tests_require'
warnings.warn(msg)
/home/cat/.local/lib/python3.10/site-packages/setuptools/_distutils/dist.py:270: UserWarning: Unknown distribution option: 'tests_require'
warnings.warn(msg)
/home/cat/.local/lib/python3.10/site-packages/setuptools/_distutils/dist.py:270: UserWarning: Unknown distribution option: 'tests_require'
warnings.warn(msg)
/home/cat/.local/lib/python3.10/site-packages/setuptools/_distutils/dist.py:270: UserWarning: Unknown distribution option: 'tests_require'
warnings.warn(msg)
/home/cat/.local/lib/python3.10/site-packages/setuptools/_distutils/dist.py:270: UserWarning: Unknown distribution option: 'tests_require'
warnings.warn(msg)
/home/cat/.local/lib/python3.10/site-packages/setuptools/_distutils/dist.py:270: UserWarning: Unknown distribution option: 'tests_require'
warnings.warn(msg)
--- stderr: learning_cv
/home/cat/.local/lib/python3.10/site-packages/setuptools/_distutils/dist.py:270: UserWarning: Unknown distribution option: 'tests_require'
warnings.warn(msg)
Traceback (most recent call last):
File "/home/cat/dev_ws_1/src/ros2_21_tutorials/learning_cv/setup.py", line 5, in <module>
setup(
File "/home/cat/.local/lib/python3.10/site-packages/setuptools/init.py", line 117, in setup
return distutils.core.setup(**attrs)
File "/home/cat/.local/lib/python3.10/site-packages/setuptools/_distutils/core.py", line 186, in setup
return run_commands(dist)
File "/home/cat/.local/lib/python3.10/site-packages/setuptools/_distutils/core.py", line 202, in run_commands
dist.run_commands()
File "/home/cat/.local/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 983, in run_commands
self.run_command(cmd)
File "/home/cat/.local/lib/python3.10/site-packages/setuptools/dist.py", line 999, in run_command
super().run_command(command)
File "/home/cat/.local/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 1002, in run_command
cmd_obj.run()
File "/home/cat/.local/lib/python3.10/site-packages/setuptools/command/egg_info.py", line 312, in run
self.find_sources()
File "/home/cat/.local/lib/python3.10/site-packages/setuptools/command/egg_info.py", line 320, in find_sources
mm.run()
File "/home/cat/.local/lib/python3.10/site-packages/setuptools/command/egg_info.py", line 548, in run
self.prune_file_list()
File "/home/cat/.local/lib/python3.10/site-packages/setuptools/command/sdist.py", line 162, in prune_file_list
super().prune_file_list()
File "/home/cat/.local/lib/python3.10/site-packages/setuptools/_distutils/command/sdist.py", line 380, in prune_file_list
base_dir = self.distribution.get_fullname()
File "/home/cat/.local/lib/python3.10/site-packages/setuptools/_core_metadata.py", line 272, in get_fullname
return _distribution_fullname(self.get_name(), self.get_version())
File "/home/cat/.local/lib/python3.10/site-packages/setuptools/_core_metadata.py", line 290, in _distribution_fullname
canonicalize_version(version, strip_trailing_zero=False),
TypeError: canonicalize_version() got an unexpected keyword argument 'strip_trailing_zero'Failed <<< learning_cv [3.55s, exited with code 1]
Aborted <<< learning_gazebo [3.56s]
Aborted <<< learning_parameter [3.54s]
Aborted <<< learning_node [3.56s]
Aborted <<< learning_launch [3.93s]
Aborted <<< learning_gazebo_harmonic [3.94s]
Aborted <<< learning_interface [4.08s]
Aborted <<< learning_node_cpp [5.14s]Summary: 0 packages finished [5.41s]
1 package failed: learning_cv
7 packages aborted: learning_gazebo learning_gazebo_harmonic learning_interface learning_launch learning_node learning_node_cpp learning_parameter
4 packages had stderr output: learning_cv learning_gazebo_harmonic learning_node learning_parameter
13 packages not processedBian yi de shi hou chu xian de colcon built
-
从您提供的错误信息来看,
colcon build
过程中遇到了几个问题,主要集中在learning_cv
包上,并且由于learning_cv
的构建失败,其他依赖于它的包也被中止了。以下是具体的错误分析和可能的解决步骤:-
Unknown distribution option: 'tests_require'
这个警告通常发生在setup.py
文件中使用了setuptools
不识别的选项。tests_require
是一个在setuptools
中用来指定测试依赖的选项,但它可能在某些版本的setuptools
中不被支持或已被弃用。解决方案:
- 确保您的
setuptools
版本是最新的,或者至少是支持tests_require
的版本。可以通过运行pip install --upgrade setuptools
来升级setuptools
。 - 如果
tests_require
确实不被支持,您可能需要移除这个选项,或者改用其他方式来指定测试依赖。
- 确保您的
-
TypeError: canonicalize_version() got an unexpected keyword argument 'strip_trailing_zero'
这个错误表明canonicalize_version
函数调用时提供了一个不被期望的关键字参数strip_trailing_zero
。这通常是由于setuptools
的不同版本间的不兼容导致的。解决方案:
- 尝试降级或升级
setuptools
到一个与您的项目兼容的版本。您可以通过尝试不同的版本来找到最合适的版本。 - 检查
setup.py
中的版本号格式,确保它是标准的,并且setuptools
能够正确解析。
- 尝试降级或升级
-
整体构建流程
由于learning_cv
构建失败,其他依赖它的包也被中止了。一旦learning_cv
的问题得到解决,您应该能够重新运行colcon build
来构建整个工作区。
建议的操作步骤:
- 升级或降级
setuptools
到一个合适的版本。 - 检查并修正
learning_cv
的setup.py
文件,确保所有选项都是有效的,并且版本号格式正确。 - 清除之前的构建结果(例如,删除
build
和install
目录)。 - 重新运行
colcon build
。
如果问题仍然存在,您可能需要检查
learning_cv
的具体代码和依赖,或者寻求来自项目维护者的帮助。
以上为生成回答,仅供参考~
-
-
python 3.10.2