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]'
相关推荐
云泽野2 小时前
【Java|集合类】list遍历的6种方式
java·python·list
IMPYLH3 小时前
Python 的内置函数 reversed
笔记·python
小赖同学啊5 小时前
物联网数据安全区块链服务
开发语言·python·区块链
码荼5 小时前
学习开发之hashmap
java·python·学习·哈希算法·个人开发·小白学开发·不花钱不花时间crud
潘锦6 小时前
海量「免费」的 OPENAI KEY,你敢用吗?
安全·openai
小陈phd6 小时前
李宏毅机器学习笔记——梯度下降法
人工智能·python·机器学习
kk爱闹6 小时前
【挑战14天学完python和pytorch】- day01
android·pytorch·python
Blossom.1187 小时前
机器学习在智能建筑中的应用:能源管理与环境优化
人工智能·python·深度学习·神经网络·机器学习·机器人·sklearn
亚力山大抵7 小时前
实验六-使用PyMySQL数据存储的Flask登录系统-实验七-集成Flask-SocketIO的实时通信系统
后端·python·flask
showyoui7 小时前
Python 闭包(Closure)实战总结
开发语言·python