官术网_书友最值得收藏!

How to do it...

There are two ways to install Gym. The first one is to use pip, as follows:

pip install gym

For conda users, remember to install pip first in conda using the following command before installing Gym using pip:

conda install pip

This is because Gym is not officially available in conda as of early 2019.

Another approach is to build from source:

  1. First, clone the package directly from its Git repository:
git clone https://github.com/openai/gym
  1. Go to the downloaded folder and install Gym from there:
cd gym
pip install -e .

And now you are good to go. Feel free to play around with gym.

  1. You can also check the available gym environment by typing the following lines of code:
>>> from gym import envs
>>> print(envs.registry.all())
dict_values([EnvSpec(Copy-v0), EnvSpec(RepeatCopy-v0), EnvSpec(ReversedAddition-v0), EnvSpec(ReversedAddition3-v0), EnvSpec(DuplicatedInput-v0), EnvSpec(Reverse-v0), EnvSpec(CartPole-v0), EnvSpec(CartPole-v1), EnvSpec(MountainCar-v0), EnvSpec(MountainCarContinuous-v0), EnvSpec(Pendulum-v0), EnvSpec(Acrobot-v1), EnvSpec(LunarLander-v2), EnvSpec(LunarLanderContinuous-v2), EnvSpec(BipedalWalker-v2), EnvSpec(BipedalWalkerHardcore-v2), EnvSpec(CarRacing-v0), EnvSpec(Blackjack-v0)
...
...

This will give you a long list of environments if you installed Gym properly. We will play around with some of them in the next recipe, Simulating Atari environments.

主站蜘蛛池模板: 如皋市| 贵德县| 行唐县| 益阳市| 朝阳市| 南陵县| 阜康市| 高雄市| 万荣县| 都江堰市| 太仓市| 鄂尔多斯市| 通山县| 枝江市| 上高县| 西乌珠穆沁旗| 大冶市| 当涂县| 乌拉特中旗| 丁青县| 井研县| 敦化市| 克拉玛依市| 棋牌| 台东市| 灌阳县| 惠安县| 西城区| 明光市| 蒲江县| 财经| 靖西县| 沈阳市| 乳山市| 玛多县| 梨树县| 蚌埠市| 治县。| 苗栗县| 游戏| 松原市|