brew install swig
pip install box2d box2d-kengz
pip install gym
如果运行的时候有参数不对,那么可能是版本问题,可以去https://github.com/openai/gym/releases,看看是否有最新的版本。然后安装即可:
pip install gym==版本号
报错
zsh: no matches found: gym[atari]
解:
vim ~/.zshrc
在最后一句添了一个 setopt no_nomatch
source 一下
安装游戏环境
查看所有游戏
from gym import envs
env_names = [spec for spec in envs.registry.keys()]
for name in sorted(env_names):
print(name)
运行pong
乒乓球
报错
We’re Unable to find the game “Pong”. Note: Gym no longer distributes
ROMs. If you own a license to use the necessary ROMs
根据提示安装:
pip install gym[accept-rom-license]