环境:Pycharm,Anconda + Python3.6,Win10 x64
2019/01/21
dm_control
我对这个包的功能很感兴趣,尝试了一下。然而它的Stars只有1000+,质量不容乐观。
安装步骤按 README 中的 Installation and requirements 即可。
MuJoCo Pro 2.00的安装:https://blog.csdn.net/hizcard/article/details/86585217
dm_control内部存在MuJoCo的应用代码,因此不需要MuJoCo-py。
如果自定义了MuJoCo路径,需要在安装dm_control前修改它配置文件中的默认路径(single match)。
等到安装完,我满心期待地跑起 README 中的例程时,报出了如下错误:
Traceback (most recent call last):
File "F:/GitHub Repository/dm_control_test/main.py", line 19, in
viewer.launch(env, policy=random_policy, width=1920, height=1080)
File "D:\Anaconda3\envs\py36\lib\site-packages\dm_control\viewer\__init__.py", line 42, in launch
app = application.Application(title=title, width=width, height=height)
File "D:\Anaconda3\envs\py36\lib\site-packages\dm_control\viewer\application.py", line 191, in __init__
self._window = gui.RenderWindow(width, height, title)
TypeError: 'NoneType' object is not callable
直接原因是 dm_control\viewer\gui\__init__.py 中的 RenderWindow 没有被赋值。这样是不能顺利运行的,所以我把代码中的忽略异常删去,得到了新的错误:
Traceback (most recent call last):
File "F:/GitHub Repository/dm_control_test/main.py", line 5, in
from dm_control import viewer
File "D:\Anaconda3\envs\py36\lib\site-packages\dm_control\viewer\__init__.py", line 22, in
from dm_control.viewer import application
File "D:\Anaconda3\envs\py36\lib\site-packages\dm_control\viewer\application.py", line 24, in
from dm_control.viewer import gui
File "D:\Anaconda3\envs\py36\lib\site-packages\dm_control\viewer\gui\__init__.py", line 24, in
from dm_control.viewer.gui import glfw_gui
File "D:\Anaconda3\envs\py36\lib\site-packages\dm_control\viewer\gui\glfw_gui.py", line 25, in
from dm_control.viewer.gui import base
File "D:\Anaconda3\envs\py36\lib\site-packages\dm_control\viewer\gui\base.py", line 28, in
from OpenGL import GL
File "D:\Anaconda3\envs\py36\lib\site-packages\OpenGL\GL\__init__.py", line 3, in
from OpenGL import error as _error
File "D:\Anaconda3\envs\py36\lib\site-packages\OpenGL\error.py", line 12, in
from OpenGL import platform, _configflags
File "D:\Anaconda3\envs\py36\lib\site-packages\OpenGL\platform\__init__.py", line 35, in
_load()
File "D:\Anaconda3\envs\py36\lib\site-packages\OpenGL\platform\__init__.py", line 32, in _load
plugin.install(globals())
File "D:\Anaconda3\envs\py36\lib\site-packages\OpenGL\platform\baseplatform.py", line 92, in install
namespace[ name ] = getattr(self,name,None)
File "D:\Anaconda3\envs\py36\lib\site-packages\OpenGL\platform\baseplatform.py", line 14, in __get__
value = self.fget( obj )
File "D:\Anaconda3\envs\py36\lib\site-packages\OpenGL\platform\egl.py", line 93, in GetCurrentContext
return self.EGL.eglGetCurrentContext
File "D:\Anaconda3\envs\py36\lib\site-packages\OpenGL\platform\baseplatform.py", line 14, in __get__
value = self.fget( obj )
File "D:\Anaconda3\envs\py36\lib\site-packages\OpenGL\platform\egl.py", line 73, in EGL
raise ImportError("Unable to load EGL library", *err.args)
ImportError: ('Unable to load EGL library', 22, '找不到指定的模块。', None, 126, None, 'EGL', None)
...在系统中找不到egl库。