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编译时就不会再出现报错了

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/bicheng/4722.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

深入探索Android Service:多线程环境最佳实践与系统级操作

引言 Service作为Android平台的基石之一&#xff0c;其在多线程环境下的高级应用以及跨应用通信的能力&#xff0c;为开发者提供了构建高性能、高稳定性应用的可能。本文将深入探讨Service在多线程环境下的最佳实践&#xff0c;以及Service 与系统级操作、Service与系统资源管…

day17面向对象三大特征—封装

回顾 1.对象:一个拥有属性和方法的实例:实体 2类名 ;大骆驼峰 class 类名: 类代码 class People: 类属性 (类属性:所有的对象共有的属性) name = 一类人 def __init__(self, name, age, sex): self : 对象本身 self.name 拿到属性值 self…

SpringCloud和SpringBoot技术选型

Spring Cloud和Spring Boot在技术选型上各自具有独特的特点和优势&#xff0c;它们在不同的场景和需求下发挥着不同的作用。 Spring Boot是一个快速开发框架&#xff0c;它简化了传统MVC的XML配置&#xff0c;使得配置变得更加方便、简洁。通过采用“约定优于配置”的理念&…

【已解决】c++如何在MFC框架中按下某键触发触发事件

本博文源于昨天处理的一个事件&#xff0c;接收到回车键进行检测&#xff0c;同样的这个也可以接收其他键&#xff0c;比如A 键B键之类的。这里可以在mfc框架中使用这个函数 BOOL ****::PreTranslateMessage(MSG* pMsg);该函数会在程序运行时不停地被调用只需要你用if去拦截它…

[论文笔记]SEARCHING FOR ACTIVATION FUNCTIONS

引言 今天带来另一篇激活函数论文SEARCHING FOR ACTIVATION FUNCTIONS的笔记。 作者利用自动搜索技术来发现新的激活函数。通过结合详尽的搜索和基于强化学习的搜索&#xff0c;通过实验发现最佳的激活函数 f ( x ) x ⋅ sigmoid ( β x ) f(x) x \cdot \text{sigmoid}(βx…

Unity DOTS中的baking(五)prefabs

Unity DOTS中的baking&#xff08;五&#xff09;prefabs 在DOTS的baking过程中&#xff0c;prefabs会被烘焙成entity prefabs。entity prefabs也是一个entity&#xff0c;可以在运行时实例化&#xff0c;就像是prefab一样。我们可以使用EntityPrefabReference这个struct&#…

瓦片编辑器成功移植到小熊猫C++ 2.25.1版本,解决_findnext移植问题

移植之后出现绿色屏幕闪退 查了版本回滚直到不闪退&#xff0c;发现是在读取自定义文件上出问题 然后在找读取自定义文件函数&#xff0c;发现是读取图片部分出问题 然后就卡住了 调试半天&#xff0c;不是数据溢出&#xff0c;于是就看 函数_findnext,网上搜 ———_findn…

Java项目启动检测 Redis 是否启动,未启动则启动(macOS 版本)

文章目录 一、概述二、代码 一、概述 启动项目时&#xff0c;检测macos 上 Redis 是否启动&#xff0c;未启动&#xff0c;则启动。 二、代码 /*** 用途: 项目启动时检查 redis&#xff0c;未启动则启动&#xff08;开发环境&#xff09;** author: ADAM* create: 2024/04/2…

4.Docker本地镜像发布至阿里云仓库、私有仓库、DockerHub

文章目录 0、镜像的生成方法1、本地镜像发布到阿里云仓库2、本地镜像发布到私有仓库3、本地镜像发布到Docker Hub仓库 Docker仓库是集中存放镜像的地方&#xff0c;分为公共仓库和私有仓库。 注册服务器是存放仓库的具体服务器&#xff0c;一个注册服务器上可以有多个仓库&…

项目开发规范

Restful REST&#xff0c;表述性状态转换&#xff0c;他是一种软件架构风格 使用URL定位资源&#xff0c;HTTP动词描述操作 根据发出请求类型来区分操作 GET&#xff1a; 查询id为1的用户POST&#xff1a;新增用户PUT&#xff1a;修改用户DELETE&#xff1a;删除id为1的用户 …

springboot权限验证学习-上

创建maven项目 创建父工程 这类项目和原来项目的区别在于&#xff0c;打包方式是pom 由于pom项目一般都是用来做父项目的&#xff0c;所以该项目的src文件夹可以删除掉。 创建子工程 子工程pom.xml 父工程pom.xml 添加依赖 父工程导入依赖包 <!--导入springboot 父工程…

18.Nacos配置管理-微服务读取Nacos中的配置

需要解决的问题 1.实现配置更改热更新&#xff0c;而不是改动了配置文件还要去重启服务才能生效。 2.对多个微服务的配置文件统一集中管理。而不是需要对每个微服务逐一去修改配置文件&#xff0c;特别是公共通用的配置。 配置管理服务中的配置发生改变后&#xff0c;回去立…

病理组学+配对 mIHC 验证+转录组多组学

目录 病理DeepRisk网络模型构建 DPS和新辅助化疗 mIHC 验证 STAD转录组层面 病理DeepRisk网络模型构建 自有数据训练&#xff0c;TCGA数据进行验证&#xff0c;然后配对mIF验证&#xff0c;最后还在转录组层面分析。 该模型基于中山数据集&#xff08;n 1120&#xff09…

【AIGC调研系列】Sora级别的国产视频大模型-Vidu

Vidu能够达到Sora级别的标准。Vidu被多个来源认为是国内首个Sora级别的视频大模型[2][3][4]。它采用了团队原创的Diffusion与Transformer融合的架构U-ViT&#xff0c;能够生成长达16秒、分辨率高达1080P的高清视频内容[1][6]。此外&#xff0c;Vidu的一致性、运动幅度都达到了S…

美易官方:巴菲特股东大会召开在即,新浪财经中美投资人酒会5月4日举行

在五月的阳光下&#xff0c;全球投资者的目光都聚焦在了美国中部城市奥马哈。这里是“投资界春晚”——巴菲特股东大会的举办地&#xff0c;也是全球投资者共享投资智慧的圣地。今年的巴菲特股东大会更是备受瞩目&#xff0c;不仅有“股神”巴菲特的精彩演讲&#xff0c;还有新…

【Spring】IOC/DI中常用的注解@Lazy、@Scope与@Conditional

目录 1、Lazy 懒加载bean 1.1、与component配合使用 1.2、与Bean注解配合使用 2、Scope bean的作用域 2.1、不指定Scope 2.2、指定Scope为 prototype 3、Conditional 条件注解 1、Lazy 懒加载bean Lazy用于指定单例bean实例化的时机&#xff0c;在没有指定此注解时&…

基于SpringBoot+Vue校园竞赛管理系统的设计与实现

项目介绍&#xff1a; 传统信息的管理大部分依赖于管理人员的手工登记与管理&#xff0c;然而&#xff0c;随着近些年信息技术的迅猛发展&#xff0c;让许多比较老套的信息管理模式进行了更新迭代&#xff0c;竞赛信息因为其管理内容繁杂&#xff0c;管理数量繁多导致手工进行…

Linux学习阶段划分及学习方法

目录 Linux学习阶段划分 Linux学习方法 整理自 一周学会Linux韩顺平 Linux学习阶段划分 这节可以让你知道你目前是什么水平 1、Linux环境下基本操作命令 例如文件管理&#xff0c;用户管理&#xff0c;vi vim编辑器 2、Linux的各种配置 例如网络的配置&#xff0c;服务的…

安卓常用组件(启停活动页面、活动之间传递信息、收发应用广播、操作后台服务)

启停活动页面 Activity的启动和结束 页面跳转可以使用startActivity接口&#xff0c;具体格式为startActivity(new Intent(this, 目标页面.class));。 关闭一个页面可以直接调用finish();方法即可退出页面。 Activity的生命周期 页面在安卓有个新的名字叫活动&#xff0c;因…

单例模式及其应用

单例模式介绍&#xff1a; 单例模式是一种常见的设计模式&#xff0c;其目的是确保某个类只有一个实例存在&#xff0c;并提供一个全局访问点。 在实现单例模式时&#xff0c;一般需要注意以下几点&#xff1a; 私有化构造函数&#xff1a;防止外部直接实例化对象。私有静态…