This is a widget that embeds cefpython into a Kivy widget.
It has been tested only on Linux 64bit so far.
from kivy.app import App
from kivy.garden.cefpython import CEFBrowser
class SimpleBrowserApp(App):
def build(self):
return CEFBrowser(url="http://kivy.org")
SimpleBrowserApp().run()
This project shouldn't be considered stable. There are many things, as e.g. downloads which aren't implemented or causing proplems. Tested on Ubuntu 14.04.1 LTS 64bit with the following debian packages installed:
libnss3-1d
libnspr4-0d
If it does not work on Windows, it is most probably because not all the
needed DLLs are copied correctly from the downloaded ZIP file. You would then
need to edit lib/cefpython_sources.json
.
- Create a virtualenv:
virtualenv venv
- Install kivy into virtualenv (consult kivy docs for this)
- Install other dependencies into virtualenv:
venv/bin/pip install -r requirements.txt
- Symlink cefbrowser into graden directory:
ln -s path/to/gardne.cefpython ~/.kivy/garden/garden.cefpython
- Now you should be able to launch one of the examples:
venv/bin/python examples/minimal.py
- Create a virtual:
virtualenv venv
- Update Pip:
venv/bin/pip install -U pip
- Install Kivy into venv:
venv/bin/pip install Kivy==1.9.2-dev0xinput4 --index-url https://wheels.rentouch.ch
If you get an cert-mismatch error: use:venv/bin/pip install Kivy==1.9.2-dev0xinput4 --index-url https://wheels.rentouch.ch --trusted-host wheels.rentouch.ch
- Install other required libraries (as Cefpython) by:
venv/bin/pip install -r requirements.txt --index-url https://wheels.rentouch.ch --trusted-host wheels.rentouch.ch
- Create garden folder if not existing:
mkdir ~/.kivy/garden
- Symlink garden.cefpython into graden directory:
ln -s path/to/this/garden.cefpython ~/.kivy/garden/garden.cefpython
- Now you should be able to launch one of the examples:
venv/bin/python examples/minimal.py
Basically you have to follow the steps for 2.7 above:
virtualenv -p python3 3venv
3venv/bin/pip install Kivy==1.9.2-dev0xinput4 --index-url https://wheels.rentouch.ch --trusted-host wheels.rentouch.ch
3venv/bin/pip install cefpython3
ln -s path/to/this/garden.cefpython ~/.kivy/garden/garden.cefpython
- Documentation is poor
- API (Methods of CEFBrowser) will still be subject to change
- Keyboards sometimes don't vanish, when another element is focused, system keyboard input is sometimes redirected to multiple focused elements, etc.
- Test on all operating systems and file bug reports