Ubuntu20.04 [Ros Noetic]版本——在catkin_make编译时出现报错的解决方案

2024-04-29 12:04

本文主要是介绍Ubuntu20.04 [Ros Noetic]版本——在catkin_make编译时出现报错的解决方案,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

今天在新的笔记本电脑上进行catkin_make的编译过程中遇到了报错,这个报错在之前也遇到过,但是,我却忘了怎么解决。很是头痛!

经过多篇博客的查询,特此解决了这个编译报错的问题,于此特地记录!!!

整体报错信息如下:

Base path: /home/hjx/hjx_file/URDF_model/catkin_ws
Source space: /home/hjx/hjx_file/URDF_model/catkin_ws/src
Build space: /home/hjx/hjx_file/URDF_model/catkin_ws/build
Devel space: /home/hjx/hjx_file/URDF_model/catkin_ws/devel
Install space: /home/hjx/hjx_file/URDF_model/catkin_ws/install
####
#### Running command: "cmake /home/hjx/hjx_file/URDF_model/catkin_ws/src -DCATKIN_DEVEL_PREFIX=/home/hjx/hjx_file/URDF_model/catkin_ws/devel -DCMAKE_INSTALL_PREFIX=/home/hjx/hjx_file/URDF_model/catkin_ws/install -G Unix Makefiles" in "/home/hjx/hjx_file/URDF_model/catkin_ws/build"
####
-- Using CATKIN_DEVEL_PREFIX: /home/hjx/hjx_file/URDF_model/catkin_ws/devel
-- Using CMAKE_PREFIX_PATH: /opt/ros/noetic
-- This workspace overlays: /opt/ros/noetic
-- Found PythonInterp: /home/hjx/anaconda3/bin/python3 (found suitable version "3.11.7", minimum required is "3") 
-- Using PYTHON_EXECUTABLE: /home/hjx/anaconda3/bin/python3
-- Using Debian Python package layout
-- Using empy: /home/hjx/anaconda3/lib/python3.11/site-packages/em.py
-- Using CATKIN_ENABLE_TESTING: ON
-- Call enable_testing()
-- Using CATKIN_TEST_RESULTS_DIR: /home/hjx/hjx_file/URDF_model/catkin_ws/build/test_results
-- Forcing gtest/gmock from source, though one was otherwise available.
-- Found gtest sources under '/usr/src/googletest': gtests will be built
-- Found gmock sources under '/usr/src/googletest': gmock will be built
-- Found PythonInterp: /home/hjx/anaconda3/bin/python3 (found version "3.11.7") 
-- Using Python nosetests: /usr/bin/nosetests3
-- catkin 0.8.10
-- BUILD_SHARED_LIBS is on
-- BUILD_SHARED_LIBS is on/opt/ros/noetic/share/catkin/cmake/em/order_packages.cmake.em:2:1: error: RuntimeError: ImportError: "from catkin_pkg.topological_order import topological_order" failed: cannot import name 'Sequence' from 'collections' (/home/hjx/anaconda3/lib/python3.11/collections/__init__.py)
Make sure that you have installed "catkin_pkg", it is up to date and on the PYTHONPATH.
<root>:1:1: from this context
Traceback (most recent call last):File "<string>", line 8, in <module>File "/home/hjx/anaconda3/lib/python3.11/site-packages/catkin_pkg/topological_order.py", line 39, in <module>from .packages import find_packagesFile "/home/hjx/anaconda3/lib/python3.11/site-packages/catkin_pkg/packages.py", line 38, in <module>from .package import _get_package_xmlFile "/home/hjx/anaconda3/lib/python3.11/site-packages/catkin_pkg/package.py", line 44, in <module>from catkin_pkg.condition import evaluate_conditionFile "/home/hjx/anaconda3/lib/python3.11/site-packages/catkin_pkg/condition.py", line 17, in <module>import pyparsing as ppFile "/home/hjx/anaconda3/lib/python3.11/site-packages/pyparsing/__init__.py", line 140, in <module>from .core import __diag__, __compat__File "/home/hjx/anaconda3/lib/python3.11/site-packages/pyparsing/core.py", line 31, in <module>from pathlib import PathFile "/home/hjx/anaconda3/lib/python3.11/site-packages/pathlib.py", line 10, in <module>from collections import Sequence
ImportError: cannot import name 'Sequence' from 'collections' (/home/hjx/anaconda3/lib/python3.11/collections/__init__.py)During handling of the above exception, another exception occurred:Traceback (most recent call last):File "/home/hjx/anaconda3/lib/python3.11/site-packages/em.py", line 6323, in <module>if __name__ == '__main__': main()^^^^^^File "/home/hjx/anaconda3/lib/python3.11/site-packages/em.py", line 6320, in mainexitCode = invoke(sys.argv[1:], executable=sys.argv[0], errors=None)^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^File "/home/hjx/anaconda3/lib/python3.11/site-packages/em.py", line 6280, in invokeinterp.go(File "/home/hjx/anaconda3/lib/python3.11/site-packages/em.py", line 4724, in goself.protect(name, method, file)File "/home/hjx/anaconda3/lib/python3.11/site-packages/em.py", line 4740, in protectcallable(*args, **kwargs)File "/home/hjx/anaconda3/lib/python3.11/site-packages/em.py", line 4758, in fileself.fileChunks(file, config.buffering, locals, dispatcher)File "/home/hjx/anaconda3/lib/python3.11/site-packages/em.py", line 4804, in fileChunkswhile not self.safe(scanner, done, locals, dispatcher):^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^File "/home/hjx/anaconda3/lib/python3.11/site-packages/em.py", line 4862, in safeif dispatcher():^^^^^^^^^^^^File "/home/hjx/anaconda3/lib/python3.11/site-packages/em.py", line 5800, in dispatchself.handle((type, error, traceback), fatal)File "/home/hjx/anaconda3/lib/python3.11/site-packages/em.py", line 4843, in safereturn self.parse(scanner, locals)^^^^^^^^^^^^^^^^^^^^^^^^^^^File "/home/hjx/anaconda3/lib/python3.11/site-packages/em.py", line 4874, in parseself.run(token, locals)File "/home/hjx/anaconda3/lib/python3.11/site-packages/em.py", line 5115, in runtoken.run(self, locals)File "/home/hjx/anaconda3/lib/python3.11/site-packages/em.py", line 2571, in runinterp.execute(self.code, locals)File "/home/hjx/anaconda3/lib/python3.11/site-packages/em.py", line 5178, in executeself.core.execute(statements, self.globals, locals)File "/home/hjx/anaconda3/lib/python3.11/site-packages/em.py", line 4228, in executeexecFunc(code, globals)File "<string>", line 10, in <module>
RuntimeError: ImportError: "from catkin_pkg.topological_order import topological_order" failed: cannot import name 'Sequence' from 'collections' (/home/hjx/anaconda3/lib/python3.11/collections/__init__.py)
Make sure that you have installed "catkin_pkg", it is up to date and on the PYTHONPATH.
CMake Error at /opt/ros/noetic/share/catkin/cmake/safe_execute_process.cmake:11 (message):execute_process(/home/hjx/hjx_file/URDF_model/catkin_ws/build/catkin_generated/env_cached.sh"/home/hjx/anaconda3/bin/python3""/home/hjx/anaconda3/lib/python3.11/site-packages/em.py" "--raw-errors""-F""/home/hjx/hjx_file/URDF_model/catkin_ws/build/catkin_generated/order_packages.py""-o""/home/hjx/hjx_file/URDF_model/catkin_ws/build/catkin_generated/order_packages.cmake""/opt/ros/noetic/share/catkin/cmake/em/order_packages.cmake.em") returnederror code 1
Call Stack (most recent call first):/opt/ros/noetic/share/catkin/cmake/em_expand.cmake:25 (safe_execute_process)/opt/ros/noetic/share/catkin/cmake/catkin_workspace.cmake:35 (em_expand)CMakeLists.txt:69 (catkin_workspace)-- Configuring incomplete, errors occurred!
See also "/home/hjx/hjx_file/URDF_model/catkin_ws/build/CMakeFiles/CMakeOutput.log".
See also "/home/hjx/hjx_file/URDF_model/catkin_ws/build/CMakeFiles/CMakeError.log".
Invoking "cmake" failed

关于报错界面的部分截图:

关于我在执行catkin_make是遇到的报错关键信息如下:

RuntimeError: ImportError: "from catkin_pkg.topological_order import topological_order" failed: cannot import name 'Sequence' from 'collections' (/home/hjx/anaconda3/lib/python3.11/collections/__init__.py)
Make sure that you have installed "catkin_pkg", it is up to date and on the PYTHONPATH.
CMake Error at /opt/ros/noetic/share/catkin/cmake/safe_execute_process.cmake:11 (message):execute_process(/home/hjx/hjx_file/URDF_model/catkin_ws/build/catkin_generated/env_cached.sh"/home/hjx/anaconda3/bin/python3""/home/hjx/anaconda3/lib/python3.11/site-packages/em.py" "--raw-errors""-F""/home/hjx/hjx_file/URDF_model/catkin_ws/build/catkin_generated/order_packages.py""-o""/home/hjx/hjx_file/URDF_model/catkin_ws/build/catkin_generated/order_packages.cmake""/opt/ros/noetic/share/catkin/cmake/em/order_packages.cmake.em") returnederror code 1
Call Stack (most recent call first):/opt/ros/noetic/share/catkin/cmake/em_expand.cmake:25 (safe_execute_process)/opt/ros/noetic/share/catkin/cmake/catkin_workspace.cmake:35 (em_expand)CMakeLists.txt:69 (catkin_workspace)-- Configuring incomplete, errors occurred!
See also "/home/hjx/hjx_file/URDF_model/catkin_ws/build/CMakeFiles/CMakeOutput.log".
See also "/home/hjx/hjx_file/URDF_model/catkin_ws/build/CMakeFiles/CMakeError.log".
Invoking "cmake" failed

其实,关键的报错点如下:

CMake Error at /opt/ros/noetic/share/catkin/cmake/safe_execute_process.cmake:11 (message):

根据这个报错提示,我找到了几篇相关的博客:

Ubuntu20.04安装Ros Noetic版本,在catkin_make编译时出现的问题_could not find py_em (missing: py_em)-CSDN博客

Ubuntu 20.04 ROS noetic 问题解决_cmake error at /opt/ros/noetic/share/catkin/cmake/-CSDN博客

 根据上面这2篇博客其实就可以解决问题了

下面为给出解决这个报错的终端指令:

catkin_make -DPYTHON_EXECUTABLE=/usr/bin/python3

 便可完成工作空间的创建!

下图是我catkin_make成功的页面截图:

 后面再次进行catkin_make编译时就不会再出现报错了

这篇关于Ubuntu20.04 [Ros Noetic]版本——在catkin_make编译时出现报错的解决方案的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/946033

相关文章

Android实现任意版本设置默认的锁屏壁纸和桌面壁纸(两张壁纸可不一致)

客户有些需求需要设置默认壁纸和锁屏壁纸  在默认情况下 这两个壁纸是相同的  如果需要默认的锁屏壁纸和桌面壁纸不一样 需要额外修改 Android13实现 替换默认桌面壁纸: 将图片文件替换frameworks/base/core/res/res/drawable-nodpi/default_wallpaper.*  (注意不能是bmp格式) 替换默认锁屏壁纸: 将图片资源放入vendo

maven 编译构建可以执行的jar包

💝💝💝欢迎莅临我的博客,很高兴能够在这里和您见面!希望您在这里可以感受到一份轻松愉快的氛围,不仅可以获得有趣的内容和知识,也可以畅所欲言、分享您的想法和见解。 推荐:「stormsha的主页」👈,「stormsha的知识库」👈持续学习,不断总结,共同进步,为了踏实,做好当下事儿~ 专栏导航 Python系列: Python面试题合集,剑指大厂Git系列: Git操作技巧GO

js异步提交form表单的解决方案

1.定义异步提交表单的方法 (通用方法) /*** 异步提交form表单* @param options {form:form表单元素,success:执行成功后处理函数}* <span style="color:#ff0000;"><strong>@注意 后台接收参数要解码否则中文会导致乱码 如:URLDecoder.decode(param,"UTF-8")</strong></span>

Jenkins 插件 地址证书报错问题解决思路

问题提示摘要: SunCertPathBuilderException: unable to find valid certification path to requested target...... 网上很多的解决方式是更新站点的地址,我这里修改了一个日本的地址(清华镜像也好),其实发现是解决不了上述的报错问题的,其实,最终拉去插件的时候,会提示证书的问题,几经周折找到了其中一遍博文

Windows环境利用VS2022编译 libvpx 源码教程

libvpx libvpx 是一个开源的视频编码库,由 WebM 项目开发和维护,专门用于 VP8 和 VP9 视频编码格式的编解码处理。它支持高质量的视频压缩,广泛应用于视频会议、在线教育、视频直播服务等多种场景中。libvpx 的特点包括跨平台兼容性、硬件加速支持以及灵活的接口设计,使其可以轻松集成到各种应用程序中。 libvpx 的安装和配置过程相对简单,用户可以从官方网站下载源代码

【Python报错已解决】AttributeError: ‘list‘ object has no attribute ‘text‘

🎬 鸽芷咕:个人主页  🔥 个人专栏: 《C++干货基地》《粉丝福利》 ⛺️生活的理想,就是为了理想的生活! 文章目录 前言一、问题描述1.1 报错示例1.2 报错分析1.3 解决思路 二、解决方法2.1 方法一:检查属性名2.2 步骤二:访问列表元素的属性 三、其他解决方法四、总结 前言 在Python编程中,属性错误(At

PostgreSQL中的多版本并发控制(MVCC)深入解析

引言 PostgreSQL作为一款强大的开源关系数据库管理系统,以其高性能、高可靠性和丰富的功能特性而广受欢迎。在并发控制方面,PostgreSQL采用了多版本并发控制(MVCC)机制,该机制为数据库提供了高效的数据访问和更新能力,同时保证了数据的一致性和隔离性。本文将深入解析PostgreSQL中的MVCC功能,探讨其工作原理、使用场景,并通过具体SQL示例来展示其在实际应用中的表现。 一、

明明的随机数处理问题分析与解决方案

明明的随机数处理问题分析与解决方案 引言问题描述解决方案数据结构设计具体步骤伪代码C语言实现详细解释读取输入去重操作排序操作输出结果复杂度分析 引言 明明生成了N个1到500之间的随机整数,我们需要对这些整数进行处理,删去重复的数字,然后进行排序并输出结果。本文将详细讲解如何通过算法、数据结构以及C语言来解决这个问题。我们将会使用数组和哈希表来实现去重操作,再利用排序算法对结果

UE5 半透明阴影 快速解决方案

Step 1: 打开该选项 Step 2: 将半透明材质给到模型后,设置光照的Shadow Resolution Scale,越大,阴影的效果越好

DBeaver 连接 MySQL 报错 Public Key Retrieval is not allowed

DBeaver 连接 MySQL 报错 Public Key Retrieval is not allowed 文章目录 DBeaver 连接 MySQL 报错 Public Key Retrieval is not allowed问题解决办法 问题 使用 DBeaver 连接 MySQL 数据库的时候, 一直报错下面的错误 Public Key Retrieval is