LoginSignup
7
7

More than 5 years have passed since last update.

KivyでOpenGLが2.0以上なのに認識せず Kivy Fatal Errorになるとき(Windowsのみ)

Last updated at Posted at 2017-12-06

環境

Pythonのバージョン: 3.6.2
Kivyのバージョン: 1.10.0
Windows 10

内容

実行時に↓のようなメッセージが表示され、アプリケーションが終了する

Kivy Fatal Error
GL: Minimum required OpenGL version(2.0) NOT found!
OpenGL Version detected: 1.1
Version: b'1.1.0'
Vendor: b'Microsoft Corporation'
Renderer: b'GDI Generic'
Try Upgrading your graphics drivers and/or your graphics hardware in case of
problems.
The application will leave now

解決方法

(注意:この方法はWindowsで動作します。)
kivyで使用するOpenGLのバックエンドをangle_sdl2に変更します。
angle_sdl2を利用するにはkivy.deps.sdl2とkivy.deps.angleが必要なので、
pipでkivy.deps.sdl2とkivy.deps.angleをインストールします。
python -m pip install kivy.deps.sdl2
python -m pip install kivy.deps.angle

方法#1

次に、コードの先頭に

myapp.py
import os
os.environ ['KIVY_GL_BACKEND'] = 'angle_sdl2' 

と記述すれば実行できます。

方法#2

環境変数 KIVY_GL_BACKEND を追加し、値をangle_sdl2に設定すれば実行できます。

参考元:
https://github.com/kivy/kivy/issues/3576
https://kivy.org/docs/api-kivy.graphics.cgl.html#module-kivy.graphics.cgl

7
7
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
7
7