Skip to content

Instantly share code, notes, and snippets.

@kived
Created July 13, 2015 18:15
Show Gist options
  • Save kived/5516a6047de4d99feb41 to your computer and use it in GitHub Desktop.
Save kived/5516a6047de4d99feb41 to your computer and use it in GitHub Desktop.
Kivy: CEF init
# Newer Kivy versions include a Gtk+3 clipboard, and CEF will try to use Gtk+2, which
# causes an error. Importing Gtk from gi first fixes the issue.
try:
from gi.repository import Gtk
except ImportError:
pass
# cefpython import overwrites LD_LIBRARY_PATH. Bad module, BAD!
env_ld_library_path = os.environ.get('LD_LIBRARY_PATH', None)
from cefpython3 import cefpython # must be imported FIRST due to a tc_malloc hook
if env_ld_library_path:
os.environ['LD_LIBRARY_PATH'] += ':' + env_ld_library_path
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment