Skip to content


Subversion checkout URL

You can clone with
Download ZIP


bittner edited this page · 5 revisions

Installing pyjs and pyjs Desktop on Ubuntu


This page explains how to install and run pyjs and pyjs Desktop with WebKitGTK on Ubuntu (11.10).

Getting And Building pyjs

$ git clone

This should create a directory pyjs/ containing the current development source code.

Run to create the bin/ directory, containing wrapper programs necessary to compile pyjs applications, and also to create the file pyjd/ for pyjs Desktop integration:

$ cd pyjs
pyjs$ python

It is useful to add the bin/ directory to your PATH variable (and/or to ~/.bashrc), for example:

pyjs$ export PATH=`pwd`/bin:$PATH

Testing pyjs

A first test can be done now:

pyjs$ cd examples/helloworld/
pyjs/examples/helloworld$ ./

This generates a directory output/ containing Hello.html and a lot of other files and directories.

Now you can open output/Hello.html in firefox:

pyjs/examples/helloworld$ firefox output/Hello.html

Now go back to the pyjs/ root directory for the next step:

pyjs/examples/helloworld$ cd ../..

Setting Up pyjs Desktop: Webkit


pythonwebkit doesn't support Canvas applications. If you intend to run an app that uses Canvas, instead try xulrunner.

Detailed instructions are available at

Install libwebkit for it's dependencies, and then remove it:

sudo apt-get build-dep libwebkit-dev
sudo apt-get install libwebkit-dev
sudo apt-get remove libwebkit-dev

Other required packages:

sudo apt-get install build-essential
sudo apt-get install python-dev python-ply python-gtk2-dev
sudo apt-get install gnome-common gtk-doc-tools libxml2-dev

Get the pythonwebkit code:

git clone --depth 1 git://
cd pythonwebkit
git checkout python_codegen

Compile the sources:

mkdir build
cd build

sudo make install
cd ../..

Update the shared libraries:

sudo ldconfig

Quick sanity check that python can import pywebkitgkt:

>>> import pywebkitgtk

If there is a problem here it may be helpful to check /etc/ to ensure it contains /usr/local/lib, and also to run ldconfig -p to double-check that the python webkit library is listed. Also consider doing ldd /usr/local/lib/ and double-check that the library can find all its runtime libs.

Create the pyjdrc file:

mkdir ~/.pyjd
vi ~/.pyjd/pyjdrc

Save the following 2 lines in ~/.pyjd/pyjdrc:


Setup pyjs:

cd pyjs
python build
sudo python install

Finally, test the Mail application using pyjs Desktop:

cd examples/mail

Running The Test Suite

In pyjs/examples/libtest, follow the README.

See also

Something went wrong with that request. Please try again.