OpenAI gym: Trouble installing Atari dependency (Mac OS X)

题意:

使用OpenAI Gym库时,安装Atari环境可能会遇到一些依赖问题,尤其是在Mac OS X系统上

问题背景:

I'm new to OpenAI gym. I've successfully installed OpenAI gym on my Mac OS X (High Sierra 10.13.3) laptop and made a DQN for the CartPole game. I'm trying to install the Atari dependency to use MsPacman. I tried:

我是OpenAI Gym的新手。我已经成功在我的Mac OS X(High Sierra 10.13.3)笔记本电脑上安装了OpenAI Gym,并为CartPole游戏制作了一个DQN(深度Q网络)。我现在正尝试安装Atari依赖项以使用MsPacman。我尝试了以下方法:

python 复制代码
$ pip install gym[atari]

And get that Atari is successfully installed (I see atari_py in the same directory as gym and atari within the gym directory). But when I run the code I get:

并且我已经成功安装了Atari(我在gym目录中的与gym和atari相同的目录下看到了atari_py)。但是当我运行代码时,我得到了:

python 复制代码
raise error.DependencyNotInstalled("{}. (HINT: you can install Atari dependencies by running 'pip install gym[atari]'.)".format(e))
gym.error.DependencyNotInstalled: No module named atari_py. (HINT: you can install Atari dependencies by running 'pip install gym[atari]'.)

If I add: 如果我添加

python 复制代码
import atari_py

to the source file, I get: 添加到源文件,后得到如下信息

python 复制代码
File "dqn.py", line 9, in <module>
    import atari_py
ImportError: No module named atari_py

Edit: as per the documentation, I also tried

编辑:根据文档,我也尝试了

python 复制代码
pip install -e '.[atari]'

And I get: 得到以下信息

python 复制代码
Directory '.' is not installable. File 'setup.py' not found.

Any thoughts?

有什么想法吗?

问题解决:

I had the same problem, this worked for me:

我也遇到了同样的问题,这样解决了我的问题:

python 复制代码
pip install 'gym[atari]'
相关推荐
humbinal12 小时前
同时支持 gui & cli 的 parquet 文件查看工具,高性能小清新!
hive·python·rust·spark·开源·github·parquet
Summer-Bright12 小时前
深度 | Agent 协议标准化:一场决定了 AI 经济底层规则的基础设施战争
java·数据库·人工智能·ai
曦尧12 小时前
Claude Agent Skills:用文件夹封装专业流程,AI 应用从「提示工程」走向「能力工程」
ai·自动化
90后的晨仔12 小时前
Python 开发完全指南:从入门到工程化落地
python
Mikowoo00713 小时前
批量汇总XML格式的发票信息
xml·python
lhxcc_fly13 小时前
LangGraph 项目部署知识点总结
ai·langchain·项目部署·langgraph
胡耀超13 小时前
从一次批量爬取到生产同步:问题变了,建设边界也要跟着变
爬虫·python·系统架构·数据治理·数据同步·接口设计·爬虫工程
旅僧13 小时前
王树森老师强化学习--同声传译版3
python·深度学习
梦想不只是梦与想13 小时前
python中精度处理:decimal
python·float·精度丢失·decimal·浮点运算
大模型码小白13 小时前
向量化引擎与 AI 排障:当 SIMD 遇到异常检测,存储诊断的范式转移
java·大数据·数据库·人工智能·python