英文:
pip install gymnasium[box2d] not working on Google Colab
问题
我已经在gymnasium环境中工作了几周了,之前在Google Colab中使用以下命令在笔记本中没有问题:pip3 install gymnasium[box2d]
。然而,没有改变任何内容,我再次运行该命令,它突然停止正确安装Box2d。
我得到以下输出:
Looking in indexes: https://pypi.org/simple, https://us-python.pkg.dev/colab-wheels/public/simple/
Collecting gymnasium[box2d]
Downloading gymnasium-0.28.1-py3-none-any.whl (925 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 925.5/925.5 kB 19.7 MB/s eta 0:00:00
Requirement already satisfied: numpy>=1.21.0 in /usr/local/lib/python3.10/dist-packages (from gymnasium[box2d]) (1.22.4)
Collecting jax-jumpy>=1.0.0 (from gymnasium[box2d])
Downloading jax_jumpy-1.0.0-py3-none-any.whl (20 kB)
Requirement already satisfied: cloudpickle>=1.2.0 in /usr/local/lib/python3.10/dist-packages (from gymnasium[box2d]) (2.2.1)
Requirement already satisfied: typing-extensions>=4.3.0 in /usr/local/lib/python3.10/dist-packages (from gymnasium[box2d]) (4.5.0)
Collecting farama-notifications>=0.0.1 (from gymnasium[box2d])
Downloading Farama_Notifications-0.0.4-py3-none-any.whl (2.5 kB)
Collecting box2d-py==2.3.5 (from gymnasium[box2d])
Downloading box2d-py-2.3.5.tar.gz (374 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 374.4/374.4 kB 11.0 MB/s eta 0:00:00
Preparing metadata (setup.py) ... done
Collecting pygame==2.1.3 (from gymnasium[box2d])
Downloading pygame-2.1.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (13.7 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 13.7/13.7 MB 28.2 MB/s eta 0:00:00
Collecting swig==4.* (from gymnasium[box2d])
Downloading swig-4.1.1-py2.py3-none-manylinux_2_5_x86_64.manylinux1_x86_64.whl (1.8 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.8/1.8 MB 13.0 MB/s eta 0:00:00
Building wheels for collected packages: box2d-py
error: subprocess-exited-with-error
× python setup.py bdist_wheel did not run successfully.
│ exit code: 1
╰─> See above for output.
note: This error originates from a subprocess, and is likely not a problem with pip.
Building wheel for box2d-py (setup.py) ... error
ERROR: Failed building wheel for box2d-py
Running setup.py clean for box2d-py
Failed to build box2d-py
ERROR: Could not build wheels for box2d-py, which is required to install pyproject.toml-based projects
我尝试更改gymnasium的版本,甚至尝试从gym简单安装,但错误仍然存在。我不知道发生了什么,因为昨天我完全没有这个问题。
英文:
I have been working with the gymnasium environment for some weeks now and I had no problems with it in Google Colab by using this command in the notebook: pip3 install gymnasium[box2d]
However, without changing anything I try to run the command once again and it suddenly stopped installing Box2d properly.
I get the following output:
Looking in indexes: https://pypi.org/simple, https://us-python.pkg.dev/colab-wheels/public/simple/
Collecting gymnasium[box2d]
Downloading gymnasium-0.28.1-py3-none-any.whl (925 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 925.5/925.5 kB 19.7 MB/s eta 0:00:00
Requirement already satisfied: numpy>=1.21.0 in /usr/local/lib/python3.10/dist-packages (from gymnasium[box2d]) (1.22.4)
Collecting jax-jumpy>=1.0.0 (from gymnasium[box2d])
Downloading jax_jumpy-1.0.0-py3-none-any.whl (20 kB)
Requirement already satisfied: cloudpickle>=1.2.0 in /usr/local/lib/python3.10/dist-packages (from gymnasium[box2d]) (2.2.1)
Requirement already satisfied: typing-extensions>=4.3.0 in /usr/local/lib/python3.10/dist-packages (from gymnasium[box2d]) (4.5.0)
Collecting farama-notifications>=0.0.1 (from gymnasium[box2d])
Downloading Farama_Notifications-0.0.4-py3-none-any.whl (2.5 kB)
Collecting box2d-py==2.3.5 (from gymnasium[box2d])
Downloading box2d-py-2.3.5.tar.gz (374 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 374.4/374.4 kB 11.0 MB/s eta 0:00:00
Preparing metadata (setup.py) ... done
Collecting pygame==2.1.3 (from gymnasium[box2d])
Downloading pygame-2.1.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (13.7 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 13.7/13.7 MB 28.2 MB/s eta 0:00:00
Collecting swig==4.* (from gymnasium[box2d])
Downloading swig-4.1.1-py2.py3-none-manylinux_2_5_x86_64.manylinux1_x86_64.whl (1.8 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.8/1.8 MB 13.0 MB/s eta 0:00:00
Building wheels for collected packages: box2d-py
error: subprocess-exited-with-error
× python setup.py bdist_wheel did not run successfully.
│ exit code: 1
╰─> See above for output.
note: This error originates from a subprocess, and is likely not a problem with pip.
Building wheel for box2d-py (setup.py) ... error
ERROR: Failed building wheel for box2d-py
Running setup.py clean for box2d-py
Failed to build box2d-py
ERROR: Could not build wheels for box2d-py, which is required to install pyproject.toml-based projects
I tried changing versions of gymnasium and even installing simply from gym, but the error persists. I don't know what's going on because literally yesterday I was not having any problems with this.
答案1
得分: 12
我遇到了相同的问题。经过一些调查和大量的试错,我通过首先运行 pip install swig
成功使其工作。
希望这有所帮助。
英文:
I was running into the same problem. After some digging and quite a lot of trial and error, I was able to get it to work by first running pip install swig
.
I hope that helps.
答案2
得分: 2
以下对我有用
!pip install -q swig
!pip install -q gymnasium[box2d]
英文:
The following worked for me
!pip install -q swig
!pip install -q gymnasium[box2d]
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论