How to Compile PyPy With cx_Oracle

How to Compile PyPy With cx_Oracle

PyPy ( and it's JIT (Just in Time Compiler) makes Python super fast... the advantage is awesome - especially with very large datasets. Sometimes very large datasets need to be databased, and sometimes very large databases are maintained in Oracle. The Python connector for Oracle is cx_Oracle ( This short writing will show you how to compile PyPy yourself with cx_Oracle so that you too can handle massive datasets easily with PyPy. This was done on Ubuntu 10.04 LTS 64-bit.

Make sure you have Mercurial (distributed version control system) installed:

sudo apt-get install mercurial

Download and install build time dependencies:

sudo apt-get install gcc make python-dev libffi-dev pkg-config libz-dev libbz2-dev libncurses-dev libexpat1-dev libssl-dev libgc-dev python-sphinx

sudo easy_install greenlet

Get the latest version from

hg clone

Or download latest stable:

tar -xvf pypy*

Now enter the goal directory:

cd pypy/pypy/translator/goal/

And now compile with cx_Oracle included (this can take awhile):

python -Ojit --withmod-oracle

ClassyBits 2016