admin管理员组

文章数量:1336193

Sorry if this is a silly question, but I can't figure this one out.

I am trying to install gymnasium with Atari games using conda. Here is my setup.py:

from setuptools import find_packages
from setuptools import setup

setup(
    name="benchmarks",
    version="0.0.0",
    ...
    packages=find_packages(),
    scripts=["scripts/run_training"],
    include_package_data=True,
    install_requires=[
        # "gymnasium==1.0.0",
        # or "gymnasium-atari==1.0.0",
        "pytorch==2.5.1",
        "pytorchrl==0.6.0",
    ],
    python_requires="~=3.11",
    ...
)

My code:

import gymnasium as gym
import ale_py


if __name__ == '__main__':
    gym.register_envs(ale_py)
    env = gym.make("ALE/Pong-v5")

When I import "gymnasium==1.0.0", I get the error:

ModuleNotFoundError: No module named 'ale_py'

When I import "gymnasium-atari==1.0.0", I get the error:

FileNotFoundError: [Errno 2] No such file or directory: '[...]/lib/python3.11/site-packages/ale_py/roms/pong.bin'

I have also tried to import "ale_py==0.10.1" but it seems to be a dependency of both previously mentioned packages, and did not change anything.

What am I missing?

本文标签: pythonInstall gymnasium with atari games using condaStack Overflow