pyglet当试图在docker容器内运行openai gym时,没有标准配置可用

时间:2018-03-05 23:36:03

标签: python docker openai-gym

我可以按照video中的说明使用docker容器获取GUI。 (通过尝试启动firefox测试)

我已经安装了OpenAI健身房。

尝试运行示例代码here时出现以下错误

libGL error: No matching fbConfigs or visuals found libGL error: failed to load driver: swrast Traceback (most recent call last): File "<stdin>", line 2, in <module> File "/root/miniconda3/envs/reinforcement-learning/lib/python3.5/site-packages/gym/core.py", line 153, in render return self._render(mode=mode, close=close) File "/root/miniconda3/envs/reinforcement-learning/lib/python3.5/site-packages/gym/core.py", line 285, in _render return self.env.render(mode, close) File "/root/miniconda3/envs/reinforcement-learning/lib/python3.5/site-packages/gym/core.py", line 153, in render return self._render(mode=mode, close=close) File "/root/miniconda3/envs/reinforcement-learning/lib/python3.5/site-packages/gym/envs/classic_control/cartpole.py", line 114, in _render from gym.envs.classic_control import rendering File "/root/miniconda3/envs/reinforcement-learning/lib/python3.5/site-packages/gym/envs/classic_control/rendering.py", line 23, in <module> from pyglet.gl import * File "/root/miniconda3/envs/reinforcement-learning/lib/python3.5/site-packages/pyglet/gl/__init__.py", line 239, in <module> import pyglet.window File "/root/miniconda3/envs/reinforcement-learning/lib/python3.5/site-packages/pyglet/window/__init__.py", line 1896, in <module> gl._create_shadow_window() File "/root/miniconda3/envs/reinforcement-learning/lib/python3.5/site-packages/pyglet/gl/__init__.py", line 208, in _create_shadow_window _shadow_window = Window(width=1, height=1, visible=False) File "/root/miniconda3/envs/reinforcement-learning/lib/python3.5/site-packages/pyglet/window/xlib/__init__.py", line 166, in __init__ super(XlibWindow, self).__init__(*args, **kwargs) File "/root/miniconda3/envs/reinforcement-learning/lib/python3.5/site-packages/pyglet/window/__init__.py", line 517, in __init__ raise NoSuchConfigException('No standard config is available.') pyglet.window.NoSuchConfigException: No standard config is available.

1 个答案:

答案 0 :(得分:0)

如果在安装NVIDIA GPU驱动程序时未选择退出opengl库(例如,为.run文件指定-no-opengl-files选项),则可能是问题所在。我有一台没有安装这些lib的笔记本电脑,并从包含健身房环境的图像中获取了该容器,然后开始工作。但是,在装有nvidia驱动程序之外还安装了opengl lib的PC上,与上述相同的映像无法正常工作,并且引发了pyglet.window.NoSuchConfigException。 PS:我已经通过python3控制台在PC上进行了测试,发现可以使用pyglet在容器外部手动创建Window。