Monday, November 12, 2018

How to fix "Use gi.require_version('Gtk', '3.0') before import" error

Error:

gi.require_version error









Solution:

Replace the line
"from gi.repository import Gtk"

with

"import gi
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk "