title: openAI Gym NameError in Google Colaboratory
body: <p>I've just installed openAI gym on Google Colab, but when I try to run 'CartPole-v0' environment as <a href="https://gym.openai.com/docs/" rel="noreferrer">explained here</a>.</p>
  
  <p>Code:</p>
  
  <pre><code>import gym
  env = gym.make('CartPole-v0')
  for i_episode in range(20):
      observation = env.reset()
      for t in range(100):
          env.render()
          print(observation)
          action = env.action_space.sample()
          observation, reward, done, info = env.step(action)
          if done:
              print("Episode finished after {} timesteps".format(t+1))
              break
  </code></pre>
  
  <p>I get this:</p>
  
  <pre><code>WARN: gym.spaces.Box autodetected dtype as &lt;class 'numpy.float32'&gt;. Please provide explicit dtype.
  ---------------------------------------------------------------------------
  NameError                                 Traceback (most recent call last)
  &lt;ipython-input-19-a81cbed23ce4&gt; in &lt;module&gt;()
        4     observation = env.reset()
        5     for t in range(100):
  ----&gt; 6         env.render()
        7         print(observation)
        8         action = env.action_space.sample()
  
  /content/gym/gym/core.py in render(self, mode)
      282 
      283     def render(self, mode='human'):
  --&gt; 284         return self.env.render(mode)
      285 
      286     def close(self):
  
  /content/gym/gym/envs/classic_control/cartpole.py in render(self, mode)
      104 
      105         if self.viewer is None:
  --&gt; 106             from gym.envs.classic_control import rendering
      107             self.viewer = rendering.Viewer(screen_width, screen_height)
      108             l,r,t,b = -cartwidth/2, cartwidth/2, cartheight/2, -cartheight/2
  
  /content/gym/gym/envs/classic_control/rendering.py in &lt;module&gt;()
       21 
       22 try:
  ---&gt; 23     from pyglet.gl import *
       24 except ImportError as e:
       25     reraise(prefix="Error occured while running `from pyglet.gl import *`",suffix="HINT: make sure you have OpenGL install. On Ubuntu, you can run 'apt-get install python-opengl'. If you're running on a server, you may need a virtual frame buffer; something like this should work: 'xvfb-run -s \"-screen 0 1400x900x24\" python &lt;your_script.py&gt;'")
  
  /usr/local/lib/python3.6/dist-packages/pyglet/gl/__init__.py in &lt;module&gt;()
      225     else:
      226         from .carbon import CarbonConfig as Config
  --&gt; 227 del base
      228 
      229 # XXX remove
  
  NameError: name 'base' is not defined
  </code></pre>
  
  <p>The problem is the same in <a href="https://stackoverflow.com/questions/44150310/open-ai-gym-nameerror">this question about NameError in openAI gym</a></p>
  
  <p>Nothing is being rendered. I don't know how I could use this in google colab: <code>'xvfb-run -s \"-screen 0 1400x900x24\" python &lt;your_script.py&gt;'"</code></p>