google-deepmind / mujoco

Multi-Joint dynamics with Contact. A general purpose physics simulator.
https://mujoco.org
Apache License 2.0
8.21k stars 820 forks source link

Add support for python 3.13 #2232

Open smorad opened 21 hours ago

smorad commented 21 hours ago

Intro

Hi!

I am a professor at the University of Macau, and I use MuJoCo for my research on RL.

My setup

python==3.13
ubuntu==22.04

What's happening? What did you expect?

mujoco fails to install on the latest python, but succeeds on an older version of python

Steps for reproduction

pip install mujoco for python 3.13.

Code required for reproduction

The following works

conda create -n py312 python=3.12
conda activate py312
pip install mujoco

Using the latest python

conda create -n py313 python
conda activate py313
pip install mujoco

Results in

        File "/tmp/pip-build-env-y7lyori3/overlay/lib/python3.13/site-packages/setuptools/_distutils/dist.py", line 954, in run_commands
          self.run_command(cmd)
          ~~~~~~~~~~~~~~~~^^^^^
        File "/tmp/pip-build-env-y7lyori3/overlay/lib/python3.13/site-packages/setuptools/dist.py", line 994, in run_command
          super().run_command(command)
          ~~~~~~~~~~~~~~~~~~~^^^^^^^^^
        File "/tmp/pip-build-env-y7lyori3/overlay/lib/python3.13/site-packages/setuptools/_distutils/dist.py", line 973, in run_command
          cmd_obj.run()
          ~~~~~~~~~~~^^
        File "/tmp/pip-build-env-y7lyori3/overlay/lib/python3.13/site-packages/setuptools/command/bdist_wheel.py", line 383, in run
          self.run_command("build")
          ~~~~~~~~~~~~~~~~^^^^^^^^^
        File "/tmp/pip-build-env-y7lyori3/overlay/lib/python3.13/site-packages/setuptools/_distutils/cmd.py", line 316, in run_command
          self.distribution.run_command(command)
          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^
        File "/tmp/pip-build-env-y7lyori3/overlay/lib/python3.13/site-packages/setuptools/dist.py", line 994, in run_command
          super().run_command(command)
          ~~~~~~~~~~~~~~~~~~~^^^^^^^^^
        File "/tmp/pip-build-env-y7lyori3/overlay/lib/python3.13/site-packages/setuptools/_distutils/dist.py", line 973, in run_command
          cmd_obj.run()
          ~~~~~~~~~~~^^
        File "/tmp/pip-build-env-y7lyori3/overlay/lib/python3.13/site-packages/setuptools/_distutils/command/build.py", line 135, in run
          self.run_command(cmd_name)
          ~~~~~~~~~~~~~~~~^^^^^^^^^^
        File "/tmp/pip-build-env-y7lyori3/overlay/lib/python3.13/site-packages/setuptools/_distutils/cmd.py", line 316, in run_command
          self.distribution.run_command(command)
          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^
        File "/tmp/pip-build-env-y7lyori3/overlay/lib/python3.13/site-packages/setuptools/dist.py", line 994, in run_command
          super().run_command(command)
          ~~~~~~~~~~~~~~~~~~~^^^^^^^^^
        File "/tmp/pip-build-env-y7lyori3/overlay/lib/python3.13/site-packages/setuptools/_distutils/dist.py", line 973, in run_command
          cmd_obj.run()
          ~~~~~~~~~~~^^
        File "<string>", line 152, in run
        File "<string>", line 166, in _find_mujoco
      RuntimeError: MUJOCO_PATH environment variable is not set
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for mujoco
Failed to build mujoco
ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (mujoco)

Confirmations

yuvaltassa commented 20 hours ago

I don't think we support 3.13 yet? @nimrod-gileadi do you remember the status of this?

rhaschke commented 15 hours ago

I ran into the same issue. Using python 3.12 instead of 3.13 resolved the problem for me. Would be helpful, if you could provide a more meaningful error message if a specific python version is not (yet) supported.

nimrod-gileadi commented 15 hours ago

Yeah, we don't release binary wheels for Python 3.13 yet, and the error you see comes from PyPI trying and failing to build the mujoco bindings from source.