python - 从 github 安装 OpenAI Gym 环境
问题描述
有人可以逐步向我解释如何从 github 安装健身房环境吗?我尝试了一些事情,但我不明白他们在做什么,他们没有工作。经验:
py -3 -m pip install git+https://github.com/grantsrb/Gym-Snake
py -3 -m pip install -e .[dev]
这些是有问题的环境:
https://github.com/grantsrb/Gym-Snake
https://github.com/nicomon24/Sneks
当我运行以下代码时:
import gym
env=gym.make('snake-v0')
这是显示的错误消息:
Traceback (most recent call last):
File "C:\Users\Aj\AppData\Local\Programs\Python\Python38-32\lib\site-packages\gym\envs\registration.py", line 118, in spec
return self.env_specs[id]
KeyError: 'snake-v0'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Python27\snaketry.py", line 21, in <module>
env=gym.make('snake-v0')
File "C:\Users\Aj\AppData\Local\Programs\Python\Python38-32\lib\site-packages\gym\envs\registration.py", line 142, in make
return registry.make(id, **kwargs)
File "C:\Users\Aj\AppData\Local\Programs\Python\Python38-32\lib\site-packages\gym\envs\registration.py", line 86, in make
spec = self.spec(path)
File "C:\Users\Aj\AppData\Local\Programs\Python\Python38-32\lib\site-packages\gym\envs\registration.py", line 128, in spec
raise error.UnregisteredEnv('No registered env with id: {}'.format(id))
gym.error.UnregisteredEnv: No registered env with id: snake-v0
解决方案
推荐阅读
- html - 如何使用 this.sanitizer.bypassSecurityTrustStyle 作为背景色
- scala - 在调整大小之前,传单地图无法正确显示
- python - 如何从其他机器访问服务器(在 docker 容器中运行)?
- angular - cdk-virtual-scroll-viewport 使用 angular/flex-layout (row and wrap)
- c# - 附加属性在 xamarin 表单中的标签可见性中没有绑定
- c# - 如何在运行时销毁多个游戏对象?
- django - 查询api中的django动态模型对象
- go - go中如何比较两个模板,示例得到意想不到的结果
- groovy - Groovy AST INSTRUCTION_SELECTION 阶段与 SEMANTIC_ANALYSIS
- python - 使用正则表达式在字符串之前提取字符串