peter-ch / MultiNEAT

Portable NeuroEvolution Library
http://MultiNEAT.com
GNU Lesser General Public License v3.0
328 stars 104 forks source link

Problem about running 'pole_balancing.py' #46

Open winycg opened 6 years ago

winycg commented 6 years ago

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.

anton-matosov commented 5 years ago

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