MultiNEAT icon indicating copy to clipboard operation
MultiNEAT copied to clipboard

Problem about running 'pole_balancing.py'

Open winycg opened this issue 6 years ago • 1 comments

When I run the pole_balancing.py,the problem will be happen: ERROR Information: Traceback (most recent call last): File "D:/pythonproject/pole_balancing.py", line 52, in env.render() File "D:\Anaconda\lib\site-packages\gym\envs\classic_control\cartpole.py", line 107, in render self.viewer = rendering.Viewer(screen_width, screen_height) File "D:\Anaconda\lib\site-packages\gym\envs\classic_control\rendering.py", line 51, in init self.window = pyglet.window.Window(width=width, height=height, display=display) File "D:\Anaconda\lib\site-packages\pyglet\window_init_.py", line 504, in init screen = display.get_default_screen() File "D:\Anaconda\lib\site-packages\pyglet\canvas\base.py", line 73, in get_default_screen return self.get_screens()[0] File "D:\Anaconda\lib\site-packages\pyglet\canvas\base.py", line 65, in get_screens raise NotImplementedError('abstract')
NotImplementedError: abstract Exception ignored in: <bound method Viewer.del of <gym.envs.classic_control.rendering.Viewer object at 0x000001606D31D668>> Traceback (most recent call last): File "D:\Anaconda\lib\site-packages\gym\envs\classic_control\rendering.py", line 143, in del self.close() File "D:\Anaconda\lib\site-packages\gym\envs\classic_control\rendering.py", line 62, in close self.window.close() AttributeError: 'Viewer' object has no attribute 'window'

Process finished with exit code 1

But when I note ‘import MultiNEAT as NEAT’ by using '#', the ‘env.render()’ can be normal used.I don't know why.

winycg avatar Apr 01 '18 02:04 winycg

You need pythonw on windows or python.app on mac to run python scripts that need access to window sybsystem

anton-matosov avatar Dec 09 '18 05:12 anton-matosov