最近在windows下跑python程序时调用OpenGL时碰到这个问题,有没有人知道怎么解决这个问题,谢谢!
File "D:\anaconda\envs\test\lib\site-packages\OpenGL\platform\osmesa.py", line 25, in GL
mode=ctypes.RTLD_GLOBAL
File "D:\anaconda\envs\test\lib\site-packages\OpenGL\platform\ctypesloader.py", line 45, in loadLibrary
return dllType( name, mode )
File "D:\anaconda\envs\test\lib\ctypes\__init__.py", line 364, in __init__
self._handle = _dlopen(self._name, mode)
OSError: [WinError 126] 找不到指定的模块。
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<frozen importlib._bootstrap>", line 983, in _find_and_load
File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 728, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "D:\Users\hp\Desktop\code\SPIN-master\train\__init__.py", line 1, in <module>
from .trainer import Trainer
File "D:\Users\hp\Desktop\code\SPIN-master\train\trainer.py", line 11, in <module>
from utils.renderer import Renderer
File "D:\Users\hp\Desktop\code\SPIN-master\utils\renderer.py", line 6, in <module>
import pyrender
File "D:\anaconda\envs\test\lib\site-packages\pyrender\__init__.py", line 3, in <module>
from .light import Light, PointLight, DirectionalLight, SpotLight
File "D:\anaconda\envs\test\lib\site-packages\pyrender\light.py", line 10, in <module>
from OpenGL.GL import *
File "D:\anaconda\envs\test\lib\site-packages\OpenGL\GL\__init__.py", line 3, in <module>
from OpenGL import error as _error
File "D:\anaconda\envs\test\lib\site-packages\OpenGL\error.py", line 12, in <module>
from OpenGL import platform, _configflags
File "D:\anaconda\envs\test\lib\site-packages\OpenGL\platform\__init__.py", line 35, in <module>
_load()
File "D:\anaconda\envs\test\lib\site-packages\OpenGL\platform\__init__.py", line 32, in _load
plugin.install(globals())
File "D:\anaconda\envs\test\lib\site-packages\OpenGL\platform\baseplatform.py", line 92, in install
namespace[ name ] = getattr(self,name,None)
File "D:\anaconda\envs\test\lib\site-packages\OpenGL\platform\baseplatform.py", line 14, in __get__
value = self.fget( obj )
File "D:\anaconda\envs\test\lib\site-packages\OpenGL\platform\osmesa.py", line 66, in GetCurrentContext
function = self.OSMesa.OSMesaGetCurrentContext
File "D:\anaconda\envs\test\lib\site-packages\OpenGL\platform\baseplatform.py", line 14, in __get__
value = self.fget( obj )
File "D:\anaconda\envs\test\lib\site-packages\OpenGL\platform\osmesa.py", line 60, in OSMesa
def OSMesa( self ): return self.GL
File "D:\anaconda\envs\test\lib\site-packages\OpenGL\platform\baseplatform.py", line 14, in __get__
value = self.fget( obj )
File "D:\anaconda\envs\test\lib\site-packages\OpenGL\platform\osmesa.py", line 28, in GL
raise ImportError("Unable to load OpenGL library", *err.args)
ImportError: ('Unable to load OpenGL library', 22, '找不到指定的模块。', None, 126, None, 'OSMesa', None)