我正在尝试使用 OpenAI Gymnasium 在我的 Windows 机器上构建游戏环境。我读到我应该安装 ale-py 才能使用游戏环境。然而,pip 确实认为 ale-py 不存在???我错过了什么吗?任何帮助表示赞赏。请参阅下面的错误:
C:\Users\jarre>pip install ale-py
ERROR: Could not find a version that satisfies the requirement ale-py (from versions: none)
ERROR: No matching distribution found for ale-py
我在 Gymnasium 中安装 Atari 游戏环境时还遇到了另一个问题。当尝试 pip installgymnasium[atari] 时,pip 发现多个版本具有“冲突的依赖关系”,并且不会安装任何内容。
Collecting gymnasium[atari]
Using cached gymnasium-0.27.0-py3-none-any.whl.metadata (8.5 kB)
Using cached Gymnasium-0.26.3-py3-none-any.whl.metadata (5.8 kB)
INFO: pip is looking at multiple versions of gymnasium[atari] to determine which version is compatible with other requirements. This could take a while.
Using cached gymnasium-0.26.2-py3-none-any.whl.metadata (4.1 kB)
Using cached gymnasium-0.26.1-py3-none-any.whl.metadata (4.1 kB)
ERROR: Cannot install gymnasium[atari]==0.26.1, gymnasium[atari]==0.26.2 and gymnasium[atari]==0.26.3 because these package versions have conflicting dependencies.
The conflict is caused by:
gymnasium[atari] 0.26.3 depends on ale-py~=0.8.0; extra == "atari"
gymnasium[atari] 0.26.2 depends on ale-py~=0.8.0; extra == "atari"
gymnasium[atari] 0.26.1 depends on ale-py~=0.8.0; extra == "atari"
To fix this you could try to:
1. loosen the range of package versions you've specified
2. remove package versions to allow pip attempt to solve the dependency conflict
尝试 pip installgym[atari]==0.19.0 会导致 setup.py Egg_info 出错。
C:\Users\jarre>pip3 install gym[atari]==0.19.0
Collecting gym==0.19.0 (from gym[atari]==0.19.0)
Using cached gym-0.19.0.tar.gz (1.6 MB)
Preparing metadata (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [1 lines of output]
error in gym setup command: 'extras_require' must be a dictionary whose values are strings or lists of strings containing valid project/version requirement specifiers.
[end of output]
我尝试从 https://github.com/Farama-Foundation/Arcade-Learning-Environment 安装,但它说“为 ale-py 构建轮子失败”。
Python 包索引 PyPI,pip 使用它来获取其包,没有用于 ale-py 和 Python 3.12 组合的二进制构建。 PyPI 上也没有 ale-py 的源代码发行版,因此 pip 也无法使用它来尝试在本地构建它。
使用 Python 3.11 而不是 3.12 应该可以。
或者,您可以等到 3.12 版本发布,或者在 ale-py 问题跟踪器上询问 3.12 二进制版本的状态(有时,依赖项会导致延迟,因此无法在 3.12 版本发布之前完成)依赖项兼容 3.12)。