I am reproducing the code of safety-starter-agents. To fulfill the requirements in the setup.py file, I am running the code in a virtual environment on which python3.7 is running. This python version is compatible with all required packages versions.
In particular, I downloaded the required MuJoCo 2.0.2.7 from here. I added the mjkey.txt to the ~/.mujoco directory. I added the EXPORT-path to the ~/.bashrc following this tutorial
I am running the code on WSL Ubuntu 24.04.
When I run pip install mujoco_py==2.0.2.7
, I am getting the following error:
Building wheels for collected packages: mujoco_pyBuilding wheel for mujoco_py (pyproject.toml) ... errorerror: subprocess-exited-with-error
× Building wheel for mujoco_py (pyproject.toml) did not run successfully.│ exit code: 1╰─> [95 lines of output]running bdist_wheelrunning buildperformance 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-nineq6nn/mujoco-py_1f5e0ced38f24aaea6fba7e65c0b6efd/mujoco_py/generated/cymj_2.0.2.7_37_linuxcpuextensionbuilder_37.so Compiling /tmp/pip-install-nineq6nn/mujoco-py_1f5e0ced38f24aaea6fba7e65c0b6efd/mujoco_py/cymj.pyx because it changed. [1/1] Cythonizing /tmp/pip-install-nineq6nn/mujoco-py_1f5e0ced38f24aaea6fba7e65c0b6efd/mujoco_py/cymj.pyx
I tried the suggested solutions in this link. However, changing Cython versions is not working in this specific setting.
I was able to successfully download other versions of MuJoCo on this same virtual environment. MuJoCo 2.0.2.7 is delivering this error.
Does anyone have an idea how to resolve this error?