Wrapper for running/rendering OpenAI Gym on Jupyter Notebook
Project description
Gym-Notebook-Wrapper
Gym-Notebook-Wrapper provides small wrapper for running and rendering OpenAI Gym on Jupyter Notebook or similar (e.g. Google Corab).
Requirement
- Linux
- Xvfb
- On Ubuntu, you can install
sudo apt update && sudo apt install xvfb
.
- On Ubuntu, you can install
- Open GL (for some environment)
- On Ubuntu, you can install
sudo apt update && sudo apt install python-opengl
- On Ubuntu, you can install
Installation
You can install from
PyPI with pip install gym-notebook-wrapper
Usage
Wrap gym.Env
class with gnwrapper.Animation
. That's all! The
render()
method shows the environment on its output. An example code
is following;
import gnwrapper
import gym
env = gnwrapper.Animation(gym.make('CartPole-v1'))
obs = env.reset()
for _ in range(1000):
next_obs, reward, done, info = env.step(env.action_space.sample())
env.render()
obs = next_obs
if done:
obs = env.reset()
Limitation
- Calling
render()
method delete the other output for the same cell. - The output image is shown only once.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
Close
Hashes for gym_notebook_wrapper-0.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a7fb757280a821aedd01c984eba1e576359bd8e8d57886d1dbf5657769e226a2 |
|
MD5 | 3bc51c83c93445f3873c3699b025b85d |
|
BLAKE2b-256 | 9b001bde608804126a3a1ab4ded1b207dbf8228cfdfb18bc5ce700658e364914 |