鱼香ROS社区
    • 版块
    • 最新
    • 未解决
    • 已解决
    • 群组
    • 注册
    • 登录
    紧急通知:禁止一切关于政治&VPN翻墙等话题,发现相关帖子会立马删除封号
    提问前必看的发帖注意事项: 社区问答规则(小鱼个人)更新 | 高质量帖子发布指南

    编译功能包报错

    已定时 已固定 已锁定 已移动
    多协议传输控制器
    多协议传输控制器 编译功能包
    3
    8
    365
    正在加载更多帖子
    • 从旧到新
    • 从新到旧
    • 最多赞同
    回复
    • 在新帖中回复
    登录后回复
    此主题已被删除。只有拥有主题管理权限的用户可以查看。
    • 4
      开心
      最后由 编辑

      报错日志:

      
      root@ubuntu:~/fx_cz_ws# source /opt/ros/humble/setup.bash
      root@ubuntu:~/fx_cz_ws# colcon build
      Starting >>> micro_ros_msgs
      Starting >>> robot_interfaces
      --- stderr: micro_ros_msgs
      Traceback (most recent call last):
        File "/root/fx_cz_ws/build/micro_ros_msgs/ament_cmake_python/micro_ros_msgs/setup.py", line 4, in <module>
          setup(
        File "/usr/local/lib/python3.10/dist-packages/setuptools/__init__.py", line 117, in setup
          return distutils.core.setup(**attrs)
        File "/usr/local/lib/python3.10/dist-packages/setuptools/_distutils/core.py", line 186, in setup
          return run_commands(dist)
        File "/usr/local/lib/python3.10/dist-packages/setuptools/_distutils/core.py", line 202, in run_commands
          dist.run_commands()
        File "/usr/local/lib/python3.10/dist-packages/setuptools/_distutils/dist.py", line 983, in run_commands
          self.run_command(cmd)
        File "/usr/local/lib/python3.10/dist-packages/setuptools/dist.py", line 993, in run_command
          super().run_command(command)
        File "/usr/local/lib/python3.10/dist-packages/setuptools/_distutils/dist.py", line 1002, in run_command
          cmd_obj.run()
        File "/usr/local/lib/python3.10/dist-packages/setuptools/command/egg_info.py", line 312, in run
          self.find_sources()
        File "/usr/local/lib/python3.10/dist-packages/setuptools/command/egg_info.py", line 320, in find_sources
          mm.run()
        File "/usr/local/lib/python3.10/dist-packages/setuptools/command/egg_info.py", line 548, in run
          self.prune_file_list()
        File "/usr/local/lib/python3.10/dist-packages/setuptools/command/sdist.py", line 162, in prune_file_list
          super().prune_file_list()
        File "/usr/local/lib/python3.10/dist-packages/setuptools/_distutils/command/sdist.py", line 380, in prune_file_list
          base_dir = self.distribution.get_fullname()
        File "/usr/local/lib/python3.10/dist-packages/setuptools/_core_metadata.py", line 267, in get_fullname
          return _distribution_fullname(self.get_name(), self.get_version())
        File "/usr/local/lib/python3.10/dist-packages/setuptools/_core_metadata.py", line 285, in _distribution_fullname
          canonicalize_version(version, strip_trailing_zero=False),
      TypeError: canonicalize_version() got an unexpected keyword argument 'strip_trailing_zero'
      gmake[2]: *** [CMakeFiles/ament_cmake_python_build_micro_ros_msgs_egg.dir/build.make:70:CMakeFiles/ament_cmake_python_build_micro_ros_msgs_egg] 错误 1
      gmake[1]: *** [CMakeFiles/Makefile2:447:CMakeFiles/ament_cmake_python_build_micro_ros_msgs_egg.dir/all] 错误 2
      gmake[1]: *** 正在等待未完成的任务....
      gmake: *** [Makefile:146:all] 错误 2
      ---
      Failed   <<< micro_ros_msgs [20.0s, exited with code 2]
      Aborted  <<< robot_interfaces [20.8s]
      
      Summary: 0 packages finished [22.0s]
        1 package failed: micro_ros_msgs
        1 package aborted: robot_interfaces
        2 packages had stderr output: micro_ros_msgs robot_interfaces
        1 package not processed
      
      
      小鱼小 1 条回复 最后回复 回复 引用 0
      • 小伊小
        机器人小伊
        最后由 编辑

        从错误日志来看,问题发生在编译 micro_ros_msgs 包时,具体是在 Python 的 setup.py 脚本执行过程中遇到了一个 TypeError。错误的根源在于 canonicalize_version() 函数调用时传入了一个不被期望的关键字参数 strip_trailing_zero。

        这个错误通常是由于 setuptools 库的版本与其他依赖库不兼容所导致的。可能的解决方案包括:

        1. 检查并更新 setuptools 版本:
          setuptools 的某些版本可能与其他依赖库不兼容。尝试更新 setuptools 到最新版本,看是否可以解决问题。可以使用以下命令来更新:

          pip install --upgrade setuptools
          

          注意,由于你使用的是 ROS Humble,可能需要确保在 ROS 的 Python 环境中更新 setuptools。你可以使用 rosdep 或 ROS 自带的包管理工具来确保环境的一致性。

        2. 检查其他依赖库的版本:
          如果更新 setuptools 后问题依旧存在,可能需要检查其他依赖库的版本是否兼容。特别是与 setuptools 紧密相关的库,如 wheel 或 packaging 等。

        3. 使用虚拟环境:
          为了避免系统级别的包冲突,可以考虑使用 Python 虚拟环境来隔离 ROS 和其他 Python 项目。使用 venv 或 conda 创建一个新的环境,并在其中安装 ROS 和相关依赖。

        4. 回退到旧版本的 setuptools:
          如果更新到最新版本后问题更糟,或者新版本与 ROS 不兼容,可以尝试回退到之前的版本。你可以通过查找错误报告或社区讨论来确定哪个版本是稳定的。

        5. 查看 ROS 社区和 GitHub 问题跟踪:
          有时候,这类问题可能已经被其他用户遇到并报告。查看 ROS 的官方 GitHub 仓库或相关社区论坛,看看是否有其他用户报告了相同的问题,并找到了解决方案。

        6. 清理构建环境:
          有时候,旧的构建文件可能会导致问题。尝试清理你的构建环境(如删除 build 和 install 目录),然后重新运行 colcon build。

        希望这些建议能帮助你解决问题!如果问题依旧存在,可能需要更详细的错误信息或日志来进一步诊断。


        以上为生成回答,仅供参考~

        我是小伊,已接入ChatGpt,所有回复,仅供参考~

        1 条回复 最后回复 回复 引用 0
        • 小鱼小
          小鱼 技术大佬 @43996173
          最后由 编辑

          @43996173 系统平台?删掉已经构建的install build log 再试试

          新书配套视频:https://www.bilibili.com/video/BV1GW42197Ck/

          4 1 条回复 最后回复 回复 引用 0
          • 4
            开心 @小鱼
            最后由 编辑

            @小鱼 可以在conda环境下吗?

            小鱼小 1 条回复 最后回复 回复 引用 0
            • 小鱼小
              小鱼 技术大佬 @43996173
              最后由 编辑

              @43996173 当然不行

              新书配套视频:https://www.bilibili.com/video/BV1GW42197Ck/

              4 2 条回复 最后回复 回复 引用 0
              • 4
                开心 @小鱼
                最后由 编辑

                @小鱼 问题已解决:

                pip install setuptools==64
                Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
                Collecting setuptools==64
                  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/3e/83/e206edff58159a927c76bbfeef1bf8b39cb12bbb32ae3c6227deb16d0121/setuptools-64.0.0-py3-none-any.whl (1.2 MB)
                     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.2/1.2 MB 3.7 MB/s eta 0:00:00
                WARNING: Error parsing dependencies of send2trash: Expected matching RIGHT_PARENTHESIS for LEFT_PARENTHESIS, after version specifier
                    sys-platform (=="darwin") ; extra == 'objc'
                                 ~^
                Installing collected packages: setuptools
                  Attempting uninstall: setuptools
                    Found existing installation: setuptools 75.7.0
                    Uninstalling setuptools-75.7.0:
                      Successfully uninstalled setuptools-75.7.0
                ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
                sip 6.9.1 requires setuptools>=69.5, but you have setuptools 64.0.0 which is incompatible.
                Successfully installed setuptools-64.0.0
                WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager, possibly rendering your system unusable.It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv. Use the --root-user-action option if you know what you are doing and want to suppress this warning.
                root@ubuntu:~# sudo pip install sqlmap -U
                Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
                Collecting sqlmap
                  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/4a/63/07583bdfb9079d4080287727f43a691f54166200e13e9cd2ea0092f58142/sqlmap-1.9.tar.gz (7.2 MB)
                  Preparing metadata (setup.py) ... done
                Building wheels for collected packages: sqlmap
                  Building wheel for sqlmap (setup.py) ... done
                  Created wheel for sqlmap: filename=sqlmap-1.9-py3-none-any.whl size=7553947 sha256=5390d456e7fd49453a409c541bbc685a044e4e7af15e4ddb62bde8d5c0c7499a
                  Stored in directory: /root/.cache/pip/wheels/89/6c/55/46f213852194b692cba553eddad03682b30067f9f7a0fda9d7
                Successfully built sqlmap
                WARNING: Error parsing dependencies of send2trash: Expected matching RIGHT_PARENTHESIS for LEFT_PARENTHESIS, after version specifier
                    sys-platform (=="darwin") ; extra == 'objc'
                                 ~^
                Installing collected packages: sqlmap
                Successfully installed sqlmap-1.9
                WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager, possibly rendering your system unusable.It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv. Use the --root-user-action option if you know what you are doing and want to suppress this warning.
                
                1 条回复 最后回复 回复 引用 0
                • 4
                  开心 @小鱼
                  最后由 编辑

                  @小鱼 RS485例程还是无法找到功能包

                  小鱼小 1 条回复 最后回复 回复 引用 0
                  • 小鱼小
                    小鱼 技术大佬 @43996173
                    最后由 编辑

                    @43996173 不行直接python 加文件名字先运行着

                    新书配套视频:https://www.bilibili.com/video/BV1GW42197Ck/

                    1 条回复 最后回复 回复 引用 0
                    • 第一个帖子
                      最后一个帖子
                    皖ICP备16016415号-7
                    Powered by NodeBB | 鱼香ROS