Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem about running 'pole_balancing.py' #46

Open
winycg opened this issue Apr 1, 2018 · 1 comment
Open

Problem about running 'pole_balancing.py' #46

winycg opened this issue Apr 1, 2018 · 1 comment

Comments

@winycg
Copy link

winycg commented Apr 1, 2018

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
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants