简体   繁体   English

在 Windows 10 上设置 OpenAI Gym

[英]Setting up OpenAI Gym on Windows 10

I'm trying to set up OpenAI's gym on Windows 10, so that I can do machine learning with Atari games.我正在尝试在 Windows 10 上设置 OpenAI 的健身房,以便我可以使用 Atari 游戏进行机器学习。

On PyCharm I've successfully installed gym using Settings > Project Interpreter.在 PyCharm 上,我使用 Settings > Project Interpreter 成功安装了gym。 But when I try to set up a breakout environment (or any other Atari game) using:但是当我尝试使用以下方法设置突破环境(或任何其他 Atari 游戏)时:

import gym
env = gym.make('BreakoutDeterministic-v4')

I get the following error:我收到以下错误:

ImportError: No module named 'atari_py'
...
HINT: you can install Atari dependencies by running 'pip install gym[atari]'

So I tried the command 'pip install gym[atari]' in the PyCharm terminal, and got the error:所以我在 PyCharm 终端中尝试了命令“pip installgym[atari]”,得到了错误:

Unable to execute 'make build -C atari_py/ale_interface -j 11'. HINT: are you sure `make` is installed?
error: [WinError 2] The system cannot find the file specified

I tried installing 'make' from http://gnuwin32.sourceforge.net/packages/make.htm , and tried some other methods, but this didn't solve the problem.我尝试从http://gnuwin32.sourceforge.net/packages/make.htm安装“make”,并尝试了其他一些方法,但这并没有解决问题。

I've also tried 'pip install atari_py', which runs fine but also doesn't solve the problem.我也试过“pip install atari_py”,它运行良好,但也没有解决问题。

Any ideas/help would be much appreciated.任何想法/帮助将不胜感激。 I'm new to Python and PyCharm, so I apologise if any of this was unclear.我是 Python 和 PyCharm 的新手,所以如果有任何不清楚的地方,我深表歉意。 Please let me know if there's any more info I can provide to help.请让我知道是否有更多信息可以提供帮助。

Thanks in advance提前致谢

The gym documentation https://github.com/openai/gym#installing-everything says that for using all the environments, you should have installed dependencies through pip install 'gym[all]' .健身房文档https://github.com/openai/gym#installing-everything说要使用所有环境,您应该通过pip install 'gym[all]'安装依赖项。 Can you run this command preferably through the terminal and see if it works?您能否最好通过终端运行此命令并查看它是否有效?

We currently support Linux and OS X running Python 2.7 or 3.5 -- 3.7.我们目前支持运行 Python 2.7 或 3.5 -- 3.7 的 Linux 和 OS X。 Windows support is experimental - algorithmic, toy_text, classic_control and atari should work on Windows (see next section for installation instructions); Windows 支持是实验性的 - algorithmic、toy_text、classic_control 和 atari 应该可以在 Windows 上运行(有关安装说明,请参阅下一节); nevertheless, proceed at your own risk.尽管如此,请自行承担风险。

https://github.com/openai/gym#supported-systems https://github.com/openai/gym#supported-systems

I ended up using Windows subsystem for Linux to run OpenAI Gym with Atari on Windows 10. I have written a complete guide here .我最终使用适用于 Linux 的 Windows 子系统在 Windows 10 上使用 Atari 运行 OpenAI Gym。我在这里编写了完整指南。

Works great!效果很好!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM