mujoco版本问题以及ERROR: Failed building wheel for mujoco-py

news2024/11/24 7:23:49

问题:

ERROR: Failed building wheel for mujoco-py
Failed to build mujoco-py
ERROR: Could not build wheels for mujoco-py, which is required to install pyproject.toml-based projects

起因:

一开始我使用这个命令安装pip install mujoco_py,应该下载的是最新版的mujoco_py

提示一堆话:

python main.py --algo=hjdqn --env=HalfCheetah-v2 --max_iter=1e6

You appear to be missing MuJoCo.  We expected to find the file here: /home/zhouy24/.mujoco/mujoco210

This package only provides python bindings, the library must be installed separately.

Please follow the instructions on the README to install MuJoCo

    https://github.com/openai/mujoco-py#install-mujoco

Which can be downloaded from the website

    https://www.roboti.us/index.html

Traceback (most recent call last):
  File "main.py", line 1, in <module>
    from algorithms.ddpg.ddpg import run_ddpg
  File "/data/zhouy24Files/HJDQN/HJQ/algorithms/ddpg/ddpg.py", line 4, in <module>
    import mujoco_py
  File "/home/zhouy24/miniconda3/envs/HJDQN/lib/python3.6/site-packages/mujoco_py/__init__.py", line 2, in <module>
    from mujoco_py.builder import cymj, ignore_mujoco_warnings, functions, MujocoException
  File "/home/zhouy24/miniconda3/envs/HJDQN/lib/python3.6/site-packages/mujoco_py/builder.py", line 503, in <module>
    mujoco_path = discover_mujoco()
  File "/home/zhouy24/miniconda3/envs/HJDQN/lib/python3.6/site-packages/mujoco_py/utils.py", line 78, in discover_mujoco
    raise Exception(message)
Exception: 
You appear to be missing MuJoCo.  We expected to find the file here: /home/zhouy24/.mujoco/mujoco210

This package only provides python bindings, the library must be installed separately.

Please follow the instructions on the README to install MuJoCo

    https://github.com/openai/mujoco-py#install-mujoco

Which can be downloaded from the website

    https://www.roboti.us/index.html

这里简要说明期望:mujoco210

You appear to be missing MuJoCo.  We expected to find the file here: /home/zhouy24/.mujoco/mujoco210

查看了下应该是环境问题,发现期望的 MuJoCo 版本(即 mujoco210)通常与 mujoco_py 的版本相关。

对于mujoco_py 版本:较新的 mujoco_py 版本(例如 2.1 及以上)可能只支持 MuJoCo 2.1。如果你安装了较新的 mujoco_py,但只安装了 MuJoCo 2.0,系统就会找不到对应的版本,导致错误提示。
但是我安装的就是2.0
在这里插入图片描述
在这里插入图片描述

于是我就想着指定个低点的版本,环境说是mujoco-py 2.0.2,我就选了2.0.2.13版本
然后就出现一堆问题:

(HJDQN) zhouy24@RL-DSlab:~$ pip install mujoco_py==2.0.2.13
Collecting mujoco_py==2.0.2.13
  Using cached mujoco-py-2.0.2.13.tar.gz (792 kB)
  Installing build dependencies ... done
  WARNING: Missing build requirements in pyproject.toml for mujoco_py==2.0.2.13 from https://files.pythonhosted.org/packages/2f/48/b108057c1a23c8da9f4cdc7a7c46ab7cec49c3563c0706d50f2527de6ba0/mujoco-py-2.0.2.13.tar.gz#sha256=d6ae66276b565af9063597fda70683a89c7356290f5ac3961b794ee90ec50eea.
  WARNING: The project does not specify a build backend, and pip cannot fall back to setuptools without 'wheel'.
  Getting requirements to build wheel ... done
  Installing backend dependencies ... done
  Preparing metadata (pyproject.toml) ... done
Requirement already satisfied: glfw>=1.4.0 in ./miniconda3/envs/HJDQN/lib/python3.6/site-packages (from mujoco_py==2.0.2.13) (2.7.0)
Requirement already satisfied: imageio>=2.1.2 in ./miniconda3/envs/HJDQN/lib/python3.6/site-packages (from mujoco_py==2.0.2.13) (2.15.0)
Requirement already satisfied: cffi>=1.10 in ./miniconda3/envs/HJDQN/lib/python3.6/site-packages (from mujoco_py==2.0.2.13) (1.15.1)
Requirement already satisfied: Cython>=0.27.2 in ./miniconda3/envs/HJDQN/lib/python3.6/site-packages (from mujoco_py==2.0.2.13) (3.0.11)
Requirement already satisfied: fasteners~=0.15 in ./miniconda3/envs/HJDQN/lib/python3.6/site-packages (from mujoco_py==2.0.2.13) (0.19)
Requirement already satisfied: numpy>=1.11 in ./miniconda3/envs/HJDQN/lib/python3.6/site-packages (from mujoco_py==2.0.2.13) (1.19.5)
Requirement already satisfied: pycparser in ./miniconda3/envs/HJDQN/lib/python3.6/site-packages (from cffi>=1.10->mujoco_py==2.0.2.13) (2.21)
Requirement already satisfied: pillow>=8.3.2 in ./miniconda3/envs/HJDQN/lib/python3.6/site-packages (from imageio>=2.1.2->mujoco_py==2.0.2.13) (8.4.0)
Building wheels for collected packages: mujoco-py
  Building wheel for mujoco-py (pyproject.toml) ... error
  ERROR: Command errored out with exit status 1:
   command: /home/zhouy24/miniconda3/envs/HJDQN/bin/python3.6 /home/zhouy24/miniconda3/envs/HJDQN/lib/python3.6/site-packages/pip/_vendor/pep517/in_process/_in_process.py build_wheel /tmp/tmpvd7diq0b
       cwd: /tmp/pip-install-_xct9sqd/mujoco-py_80b9891289254647b90a6b144834bee4
  Complete output (91 lines):
  running bdist_wheel
  running build
  performance hint: mujoco_py/cymj.pyx:67:5: Exception check on 'c_warning_callback' will always require the GIL to be acquired.
  Possible solutions:
        1. Declare 'c_warning_callback' as 'noexcept' if you control the definition and you're sure you don't want the function to raise exceptions.
        2. Use an 'int' return type on 'c_warning_callback' to allow an error code to be returned.
  performance hint: mujoco_py/cymj.pyx:104:5: Exception check on 'c_error_callback' will always require the GIL to be acquired.
  Possible solutions:
        1. Declare 'c_error_callback' as 'noexcept' if you control the definition and you're sure you don't want the function to raise exceptions.
        2. Use an 'int' return type on 'c_error_callback' to allow an error code to be returned.
  
  Error compiling Cython file:
  ------------------------------------------------------------
  ...
      See c_warning_callback, which is the C wrapper to the user defined function
      '''
      global py_warning_callback
      global mju_user_warning
      py_warning_callback = warn
      mju_user_warning = c_warning_callback
                         ^
  ------------------------------------------------------------
  
  mujoco_py/cymj.pyx:92:23: Cannot assign type 'void (const char *) except * nogil' to 'void (*)(const char *) noexcept nogil'. Exception values are incompatible. Suggest adding 'noexcept' to the type of 'c_warning_callback'.
  
  Error compiling Cython file:
  ------------------------------------------------------------
  ...
      See c_warning_callback, which is the C wrapper to the user defined function
      '''
      global py_error_callback
      global mju_user_error
      py_error_callback = err_callback
      mju_user_error = c_error_callback
                       ^
  ------------------------------------------------------------
  
  mujoco_py/cymj.pyx:127:21: Cannot assign type 'void (const char *) except * nogil' to 'void (*)(const char *) noexcept nogil'. Exception values are incompatible. Suggest adding 'noexcept' to the type of 'c_error_callback'.
  Removing old mujoco_py cext /tmp/pip-install-_xct9sqd/mujoco-py_80b9891289254647b90a6b144834bee4/mujoco_py/generated/cymj_2.0.2.13_36_linuxcpuextensionbuilder_36.so
  Compiling /tmp/pip-install-_xct9sqd/mujoco-py_80b9891289254647b90a6b144834bee4/mujoco_py/cymj.pyx because it changed.
  [1/1] Cythonizing /tmp/pip-install-_xct9sqd/mujoco-py_80b9891289254647b90a6b144834bee4/mujoco_py/cymj.pyx
  Traceback (most recent call last):
    File "/home/zhouy24/miniconda3/envs/HJDQN/lib/python3.6/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 363, in <module>
      main()
    File "/home/zhouy24/miniconda3/envs/HJDQN/lib/python3.6/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 345, in main
      json_out['return_val'] = hook(**hook_input['kwargs'])
    File "/home/zhouy24/miniconda3/envs/HJDQN/lib/python3.6/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 262, in build_wheel
      metadata_directory)
    File "/tmp/pip-build-env-91o0qevb/overlay/lib/python3.6/site-packages/setuptools/build_meta.py", line 231, in build_wheel
      wheel_directory, config_settings)
    File "/tmp/pip-build-env-91o0qevb/overlay/lib/python3.6/site-packages/setuptools/build_meta.py", line 215, in _build_with_temp_dir
      self.run_setup()
    File "/tmp/pip-build-env-91o0qevb/overlay/lib/python3.6/site-packages/setuptools/build_meta.py", line 268, in run_setup
      self).run_setup(setup_script=setup_script)
    File "/tmp/pip-build-env-91o0qevb/overlay/lib/python3.6/site-packages/setuptools/build_meta.py", line 158, in run_setup
      exec(compile(code, __file__, 'exec'), locals())
    File "setup.py", line 51, in <module>
      'Programming Language :: Python :: 3 :: Only',
    File "/tmp/pip-build-env-91o0qevb/overlay/lib/python3.6/site-packages/setuptools/__init__.py", line 153, in setup
      return distutils.core.setup(**attrs)
    File "/home/zhouy24/miniconda3/envs/HJDQN/lib/python3.6/distutils/core.py", line 148, in setup
      dist.run_commands()
    File "/home/zhouy24/miniconda3/envs/HJDQN/lib/python3.6/distutils/dist.py", line 955, in run_commands
      self.run_command(cmd)
    File "/home/zhouy24/miniconda3/envs/HJDQN/lib/python3.6/distutils/dist.py", line 974, in run_command
      cmd_obj.run()
    File "/tmp/pip-build-env-91o0qevb/normal/lib/python3.6/site-packages/wheel/bdist_wheel.py", line 299, in run
      self.run_command('build')
    File "/home/zhouy24/miniconda3/envs/HJDQN/lib/python3.6/distutils/cmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "/home/zhouy24/miniconda3/envs/HJDQN/lib/python3.6/distutils/dist.py", line 974, in run_command
      cmd_obj.run()
    File "setup.py", line 29, in run
      import mujoco_py  # noqa: force build
    File "/tmp/pip-install-_xct9sqd/mujoco-py_80b9891289254647b90a6b144834bee4/mujoco_py/__init__.py", line 3, in <module>
      from mujoco_py.builder import cymj, ignore_mujoco_warnings, functions, MujocoException
    File "/tmp/pip-install-_xct9sqd/mujoco-py_80b9891289254647b90a6b144834bee4/mujoco_py/builder.py", line 510, in <module>
      cymj = load_cython_ext(mujoco_path)
    File "/tmp/pip-install-_xct9sqd/mujoco-py_80b9891289254647b90a6b144834bee4/mujoco_py/builder.py", line 105, in load_cython_ext
      cext_so_path = builder.build()
    File "/tmp/pip-install-_xct9sqd/mujoco-py_80b9891289254647b90a6b144834bee4/mujoco_py/builder.py", line 221, in build
      built_so_file_path = self._build_impl()
    File "/tmp/pip-install-_xct9sqd/mujoco-py_80b9891289254647b90a6b144834bee4/mujoco_py/builder.py", line 273, in _build_impl
      so_file_path = super()._build_impl()
    File "/tmp/pip-install-_xct9sqd/mujoco-py_80b9891289254647b90a6b144834bee4/mujoco_py/builder.py", line 234, in _build_impl
      dist.ext_modules = cythonize([self.extension])
    File "/tmp/pip-build-env-91o0qevb/overlay/lib/python3.6/site-packages/Cython/Build/Dependencies.py", line 1154, in cythonize
      cythonize_one(*args)
    File "/tmp/pip-build-env-91o0qevb/overlay/lib/python3.6/site-packages/Cython/Build/Dependencies.py", line 1321, in cythonize_one
      raise CompileError(None, pyx_file)
  Cython.Compiler.Errors.CompileError: /tmp/pip-install-_xct9sqd/mujoco-py_80b9891289254647b90a6b144834bee4/mujoco_py/cymj.pyx
  ----------------------------------------
  ERROR: Failed building wheel for mujoco-py
Failed to build mujoco-py
ERROR: Could not build wheels for mujoco-py, which is required to install pyproject.toml-based projects

再次降低版本:pip install mujoco_py==2.0.2.8 发现成功

(HJDQN) zhouy24@RL-DSlab:~$ pip install mujoco_py==2.0.2.8
Collecting mujoco_py==2.0.2.8
  Using cached mujoco_py-2.0.2.8-py3-none-any.whl (4.0 MB)
Requirement already satisfied: cffi>=1.10 in ./miniconda3/envs/HJDQN/lib/python3.6/site-packages (from mujoco_py==2.0.2.8) (1.15.1)
Requirement already satisfied: fasteners~=0.15 in ./miniconda3/envs/HJDQN/lib/python3.6/site-packages (from mujoco_py==2.0.2.8) (0.19)
Requirement already satisfied: numpy>=1.11 in ./miniconda3/envs/HJDQN/lib/python3.6/site-packages (from mujoco_py==2.0.2.8) (1.19.5)
Requirement already satisfied: imageio>=2.1.2 in ./miniconda3/envs/HJDQN/lib/python3.6/site-packages (from mujoco_py==2.0.2.8) (2.15.0)
Requirement already satisfied: glfw>=1.4.0 in ./miniconda3/envs/HJDQN/lib/python3.6/site-packages (from mujoco_py==2.0.2.8) (2.7.0)
Requirement already satisfied: Cython>=0.27.2 in ./miniconda3/envs/HJDQN/lib/python3.6/site-packages (from mujoco_py==2.0.2.8) (3.0.11)
Requirement already satisfied: pycparser in ./miniconda3/envs/HJDQN/lib/python3.6/site-packages (from cffi>=1.10->mujoco_py==2.0.2.8) (2.21)
Requirement already satisfied: pillow>=8.3.2 in ./miniconda3/envs/HJDQN/lib/python3.6/site-packages (from imageio>=2.1.2->mujoco_py==2.0.2.8) (8.4.0)
Installing collected packages: mujoco-py
  Attempting uninstall: mujoco-py
    Found existing installation: mujoco-py 2.1.2.14
    Uninstalling mujoco-py-2.1.2.14:
      Successfully uninstalled mujoco-py-2.1.2.14
Successfully installed mujoco-py-2.0.2.8

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

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

相关文章

跨境卖家品牌出海要注意哪些方面

随着目前互联网的发展&#xff0c;市场由线下扩张到全国&#xff0c;再扩张到了全球&#xff0c;但是海外市场和国内并不相同跨境卖家品牌想要出海&#xff0c;需要注意多个方面&#xff0c;以确保能够在国际市场上成功立足并发展。以下是一些关键点&#xff1a; 首先想得拥有…

2-116 基于matlab的主成分分析(PCA)及累积总和(CUSUM)算法故障监测

基于matlab的主成分分析&#xff08;PCA&#xff09;及累积总和&#xff08;CUSUM&#xff09;算法故障监测&#xff0c;针对传统的多元统计分析方法对生产过程中微小故障检测不灵敏的问题&#xff0c;使用基于主元分析的累积和的微小故障检测方法进行故障监测&#xff0c;通过…

微信卸载后聊天记录全部消失,重新安装后有方法恢复吗?

微信作为我们日常沟通的重要工具&#xff0c;其聊天记录往往承载着许多珍贵的回忆和重要的信息。然而&#xff0c;在日常使用手机的过程中&#xff0c;我们时常会出于清理内存、解决软件故障或尝试新版本等原因&#xff0c;选择卸载并重新安装微信app。然而&#xff0c;这一简单…

国家公务员考试倒计时页面介绍

代码复刻 <!DOCTYPE html> <html lang"en"> <head><meta charset"UTF-8"><meta name"viewport" content"widthdevice-width, initial-scale1.0"><title>国家公务员考试倒计时</title><…

malloc(0)

malloc(0) 在操作系统底层的实现涉及内存分配管理的多个方面。下面是对 malloc(0) 的实现原理的详细解释&#xff1a; 1. 内存分配管理 操作系统通过内存管理子系统来处理内存分配请求&#xff0c;包括 malloc 函数。内存分配通常使用以下几种策略&#xff1a; 堆管理&#…

OpenFegin

文章目录 一、OpenFegin是什么&#xff1f;二、基本使用三、超时重试机制4.自定义超时重传机制五、底层实现 一、OpenFegin是什么&#xff1f; OpenFeign的全称为Spring Cloud OpenFeign(下文简称OpenFeign),是Spring Cloud团队开发的一款基于 Feign的框架&#xff0c;声明式W…

Overleaf 无法显示图片

问题描述 在Overleaf中的代码为&#xff1a; \begin{figure}\centering\includegraphics[width0.98\linewidth]{figures/test.png}\caption{This is a test.}\label{fig:test} \end{figure}但无法正常显示图片&#xff1a; 解决方案 修改编译模式为正常Normal而非快速Fast …

Python 工具库每日推荐【python-docx】

文章目录 引言Python 文档处理库的重要性今日推荐:Python-docx 工具库主要功能:使用场景:安装与配置快速上手示例代码代码解释实际应用案例案例:自动生成个性化证书案例分析高级特性样式应用表格操作扩展阅读与资源优缺点分析优点:缺点:总结【 已更新完 TypeScript 设计模…

八大排序--03插入排序

假设数组 arr[] {5,7,4,2,0,1,6},请通过插入排序的方式&#xff0c;实现从小到大排列&#xff1a; 方法&#xff1a;插入排序默认待排数组中的第一个是已经排好序的数值&#xff1b;定义游标从第二个数据开始不断向后方进行遍历&#xff0c;并将游标指向的数据不断插入到排好序…

探索Ultralytics YOLO11在视觉任务上的应用

前言 在人工智能持续发展的当下&#xff0c;有一点是确凿无疑的&#xff1a;模型正变得愈发优秀、快捷和智能。就在人们以为YOLO系列已登峰造极之时&#xff0c;Ultralytics推出了最新升级版——YOLO11。需要注意的是&#xff0c;这里不是YOLOv11&#xff0c;他们简化了命名方…

秋季猫咪掉毛严重怎么办?宠物空气净化器到底有没有用?

告别炎热的夏天&#xff0c;秋意随着家里猫咪新一轮的掉毛一起到来。我家两只布偶齐齐发力&#xff0c;疯狂掉毛&#xff0c;家里每个角落无一幸免。衣服上、地板上&#xff0c;肉眼可见家里的毛发量在不断增多&#xff0c;又陷入了日复一日的清理大战。除此之外&#xff0c;对…

erlang学习:Linux命令学习10

从百度网盘下载文件 共享百度网盘获得链接 https://pan.baidu.com/s/1iUOTAWr1SRlL2fBZ7lIV拿到链接之后在浏览器中进行下载&#xff0c;可以查看下载链接 右键这些文件即可得到下载链接 类似于长这样 https://bdbl-cm01.baidupcs.com/file/b02f72906b3d0d07130be625eabc76…

12306积分换的一等座还有零食

“12306积分换的一等座还有零食&#xff01;”这可真是个意外的惊喜呢&#xff01;平时积累的小积分&#xff0c;竟然能兑换到如此舒适的一等座车票&#xff0c;而且还附赠了精致的小零食&#xff0c;真是让人倍感贴心与满足。这样的体验&#xff0c;不仅让旅途变得更加惬意&am…

YOLOv8实战TT100K中国交通标志检测【数据集+YOLOv8模型+源码+PyQt5界面】

YOLOv8实战TT100k交通标志识别 文章目录 研究背景资源获取1.前言1.1 YOLO 系列&#xff1a;中国交通标志检测领域的璀璨明星1.2 Transformer与注意力机制&#xff1a;为中国交通标志检测注入新活力1.3 中国交通标志检测技术&#xff1a;迎接挑战&#xff0c;砥砺前行1.4 YOLOv8…

刷题训练之解决 FloodFill 算法

> 作者&#xff1a;დ旧言~ > 座右铭&#xff1a;松树千年终是朽&#xff0c;槿花一日自为荣。 > 目标&#xff1a;熟练掌握解决 FloodFill 算法。 > 毒鸡汤&#xff1a;学习&#xff0c;学习&#xff0c;再学习 ! 学&#xff0c;然后知不足。 > 专栏选自&#…

面试(十)

目录 一. 单元测试 二. FreeRTOS和裸机哪个实时性好&#xff1f; 三. 怎么判断某个程序的运行时间 四. 函数指针 五. 全局变量被线程使用冲突 5.1 使用互斥锁 5.2 使用读写锁 5.3 使用原子操作 六. 局部变量没有初始化是什么值 七. uint_8 n 255 , n等于多少 八. …

利基营销:如何为小众受众制定内容营销策略?AIGC大模型创新思维数字化转型商业模式专家培训讲师谈短视频内容社私域数字经济人工智能

了解利基营销 什么是利基营销&#xff1f; 简单来说&#xff0c;利基营销就是专注于特定范围的潜在客户群&#xff0c;而不是针对广泛的人群。 实际上&#xff0c;利基营销可以比作为拥有露营装备的人而不是所有热爱户外活动的人定制内容。露营爱好者会欣赏专门针对他们的需…

最佳实践(1)

1.Java 集合概览 Java 集合&#xff0c;也叫作容器&#xff0c;主要是由两大接口派生而来&#xff1a;一个是 Collection接口&#xff0c;主要用于存放单一元素&#xff1b;另一个是 Map 接口&#xff0c;主要用于存放键值对。对于Collection 接口&#xff0c;下面又有三个主要…

Windows 11 企业版LTSC 2024正式发布(附链接)

随着微软最新正式发布的Windows 11 24H2&#xff0c;同时也带来了大家翘首以盼的Windows 11企业版 LTSC 2024&#xff0c;我们看到了Windows操作系统在企业级稳定性和个人用户体验上的又一次飞跃。虽然LTSC&#xff08;长期服务通道&#xff09;版本主要面向企业用户&#xff0…

RabbitMQ安装(Ubuntu环境)

安装Erlang RabbitMq需要Erlang语⾔的⽀持&#xff0c;在安装rabbitMq之前需要安装erlang # 更新软件包 sudo apt-get update # 安装 erlang sudo apt-get install erlang 查看erlang版本 erl 退出命令 halt( ). 安装RabbitMQ # 更新软件包 sudo apt-get update # 安装 rabbi…