Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit bb138bb

Browse files
committed
Request a specific version of Gtk when using gi
1 parent d39f9c0 commit bb138bb

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

lib/matplotlib/backends/backend_gtk3.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,16 @@
33
import os, sys
44
def fn_name(): return sys._getframe(1).f_code.co_name
55

6+
try:
7+
import gi
8+
except ImportError:
9+
raise ImportError("Gtk3 backend requires pygobject to be installed.")
10+
11+
try:
12+
gi.require_version("Gtk", "3.0")
13+
except ValueError:
14+
raise ImportError("Gtk3 backend gtk3 development files to be installed.")
15+
616
try:
717
from gi.repository import Gtk, Gdk, GObject
818
except ImportError:

0 commit comments

Comments
 (0)