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]'
相关推荐
lapiii3581 小时前
[智能体设计模式] 第4章:反思(Reflection)
人工智能·python·设计模式
快乐非自愿2 小时前
Java垃圾收集器全解:从Serial到G1的进化之旅
java·开发语言·python
百锦再4 小时前
第11章 泛型、trait与生命周期
android·网络·人工智能·python·golang·rust·go
zbhbbedp282793cl6 小时前
如何在VSCode中安装Python扩展?
ide·vscode·python
非专业程序员Ping7 小时前
Vibe Coding 实战!花了两天时间,让 AI 写了一个富文本渲染引擎!
ios·ai·swift·claude·vibecoding
win4r8 小时前
🚀微调的力量:看3B参数的DeepSeek-OCR如何蜕变为中文识别高手!零成本微调保姆级教程:用Google Colab免费GPU,十分钟打造一个专属领域的
aigc·openai·deepseek
Python私教8 小时前
Python 开发环境安装与配置全指南(2025版)
开发语言·python
百锦再8 小时前
第12章 测试编写
android·java·开发语言·python·rust·go·erlang
熠熠仔8 小时前
QGIS 3.34+ 网络分析基础数据自动化生成:从脚本到应用
python·数据分析
测试19989 小时前
Appium使用指南与自动化测试案例详解
自动化测试·软件测试·python·测试工具·职场和发展·appium·测试用例