I am trying to get the code below to work.
import gym
env = gym.make("CartPole-v0")
env.reset()
env.render()
I have no problems running the first 3 lines but when I run the 4th I get the error:
Traceback (most recent call last):
File "<ipython-input-3-a692a1a1ffe7>", line 1, in <module>
env.render()
File "/home/mikedoho/gym/gym/core.py", line 150, in render
return self._render(mode=mode, close=close)
File "/home/mikedoho/gym/gym/core.py", line 286, in _render
return self.env.render(mode, close)
File "/home/mikedoho/gym/gym/core.py", line 150, in render
return self._render(mode=mode, close=close)
File "/home/mikedoho/gym/gym/envs/classic_control/cartpole.py", line 116, in _render
self.viewer = rendering.Viewer(screen_width, screen_height)
File "/home/mikedoho/gym/gym/envs/classic_control/rendering.py", line 51, in __init__
self.window = pyglet.window.Window(width=width, height=height, display=display)
File "/home/mikedoho/anaconda3/lib/python3.6/site-packages/pyglet/window/__init__.py", line 504, in __init__
screen = display.get_default_screen()
File "/home/mikedoho/anaconda3/lib/python3.6/site-packages/pyglet/canvas/base.py", line 73, in get_default_screen
return self.get_screens()[0]
File "/home/mikedoho/anaconda3/lib/python3.6/site-packages/pyglet/canvas/base.py", line 65, in get_screens
raise NotImplementedError('abstract')
NotImplementedError: abstract
I was hoping to get a cart on a pole to display in a new window.
This error is from code in Spyder. I am using ubuntu 16.04; python 3.6.3; IPython 6.1.0. I have not any luck using jupyter notebook.
Again I apologize. I am very new at this an just downloaded ubuntu today.