3
3

More than 3 years have passed since last update.

MacOSX Big Sur で PyOpenGL が使えなくなった時の解決策

Last updated at Posted at 2021-05-14

現象

macOS Catalina までは問題なく動いていた PyOpenGLがimport できなくなった。

from OpenGL.GL import *
from OpenGL.GLUT import *

以下のようなエラーが出る

  File "/Users/******/lib/python2.7/site-packages/OpenGL/platform/darwin.py", line 41, in GL
    raise ImportError("Unable to load OpenGL library", *err.args)
ImportError: ('Unable to load OpenGL library', 'dlopen(OpenGL, 10): image not found', 'OpenGL', None)

理由

Big Sur 以降、OpenGL が deprecated されているため。

解決策

エラーが出ているファイルの近くにある
****/lib/python2.7/site-packages/OpenGL/platform/ctypesloader.py

を修正する。

        fullName = util.find_library( name )

        fullName = "/System/Library/Frameworks/{}.framework/{}".format(name,name)

いつかは使えなくなるのかな...残して欲しい。

3
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
3