run openai gym with google compute engine
<p>I was trying to run the CartPole-v0 example on a Google Compute Engine VM.
<a href="https://gym.openai.com/docs" rel="nofollow">https://gym.openai.com/docs</a></p>

<pre><code>import gym
env = gym.make('CartPole-v0')
env.reset()
for _ in range(1000):
    env.render()
    env.step(env.action_space.sample()) # take a random action
</code></pre>

<p>I have XQuartz installed, and ssh with -X.</p>

<p>First, I was getting 
pyglet.canvas.xlib.NoSuchDisplayException: Cannot connect to "None"</p>

<p>Then according to <a href="http://www.gitterforum.com/discussion/openai-gym?page=28" rel="nofollow">http://www.gitterforum.com/discussion/openai-gym?page=28</a>, I use "xvfb-run -s "-screen 0 1400x900x24" /bin/bash"</p>

<p>Then it ran fine with the result:</p>

<pre><code>Making new env: CartPole-v0
You are calling 'step()' even though this environment has already returned done = True. You should always call 'reset()' once you receive 'done = True' -- any further steps are undefined behavior
</code></pre>

<p>But there is nothing rendered...</p>