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]'
相关推荐
用户019027581611 小时前
天勤 tqsdk 能做 A 股行情吗?期货强项与股票数据选型
python
菩提小狗2 小时前
每日极客日报 · 2026年11月13日
ai·开源·极客日报·it热点·技术资讯
2601_967979122 小时前
pip在Python中的9个必须知道的用法
python·pip·版本控制·包管理工具·requirements.txt
曲径海盗3 小时前
【Python 学习第 58 天】列表方法
python·学习笔记·编程入门
DeepVisionary3 小时前
Runway开源机器人大模型Praxis-1,推演延迟压到62毫秒
python·自动化
效率工作实验室3 小时前
企业级AI Agent平台前十名解析:按部署需求挑对更省心
ai·企业级ai·agent平台·agent平台怎么选·agent私有化部署
Cooper254 小时前
DDC 命令成功但屏幕不动:用 gamma 表重做亮度映射
python·mac
师夷长技以自愈5 小时前
手搓 AI Agent 第 7 篇:菜做砸了别硬炒——错误分类 + 双账本熔断
人工智能·python
效率工作实验室5 小时前
2026主流AI Agent平台推荐榜单:多维度对比与选型指南
ai·企业级ai·agent平台·agent平台对比·agent平台推荐
用户956256254295 小时前
15 分钟社媒简报 Agent:我只用了搜索和模型两步
python·api