Download and install
Here are the binaries of the current release — PyPy 2.0.2 — (what's new in PyPy 2.0?, fixes of PyPy 2.0.1, fix of PyPy 2.0.2) for x86 Linux, Mac OS/X, Windows. The support for ARM in 2.0(.2) is alpha-level.
“JIT Compiler” version
These binaries include a Just-in-Time compiler. They only work on x86 CPUs that have the SSE2 instruction set (most of them do, nowadays), or on x86-64 CPUs. They also contain stackless extensions, like greenlets. (This is the official release 2.0.2; for the most up-to-date version see below.)
Note that Linux binaries are dynamically linked, as is usual, and thus might not be usable due to the sad story of linux binary compatibility. This means that Linux binaries are only usable on the distributions written next to them unless you're ready to hack your system by adding symlinks to the libraries it tries to open. In general, we recommend either building from source or downloading your PyPy from your release vendor. Ubuntu (PPA), Debian, Homebrew, MacPorts, Fedora, Gentoo and Arch are known to package PyPy, with various degrees of being up-to-date. If you feel like trying a more statically linked binary (which we do not recommend using in production due to potential future security issues), you can find the older 32bit Linux and 64bit Linux at an earlier time of release 2.0.
- Linux binary (32bit, tar.bz2 built on Ubuntu 10.04.4 LTS) (see  below)
- Linux binary (64bit, tar.bz2 built on Ubuntu 12.04.2 LTS) (see  below)
- Mac OS/X binary (64bit)
- Windows binary (32bit) (you might need the VS 2008 runtime library installer vcredist_x86.exe.)
- Source (tar.bz2)
- Source (zip)
- All our downloads, including previous versions
If your CPU is really old, it may not have SSE2. In this case, you need to translate yourself with the option --jit-backend=x86-without-sse2.
: stating it again: the Linux binaries are provided for the distributions listed here. If your distribution is not exactly this one, it won't work, likely: pypy: error while loading shared libraries: …. You need to hack a lot – or you need to translate your own version from source – or you need to wait until your distribution adds a package, see above – or you can try the statically linked versions listed above.
2.0 for ARM alpha
Note: the following builds are alpha quality, for testing mostly
The other versions of PyPy are:
- The most up-to-date nightly build with a JIT, if the official release is too old for what you want to do. There are versions for different libc on this site too.
- Sandboxing: A special safe version. Read the docs about sandboxing. (It is also possible to translate a version that includes both sandboxing and the JIT compiler, although as the JIT is relatively complicated, this reduces a bit the level of confidence we can put in the result.) Note that the sandboxed binary needs a full pypy checkout to work. Consult the sandbox docs for details. (These are old, PyPy 1.8.)
All binary versions are packaged in a tar.bz2 or zip file. When uncompressed, they run in-place. For now you can uncompress them either somewhere in your home directory or, say, in /opt, and if you want, put a symlink from somewhere like /usr/local/bin/pypy to /path/to/pypy-2.0.2/bin/pypy. Do not move or copy the executable pypy outside the tree – put a symlink to it, otherwise it will not find its libraries.
Building from source
Get the source code. The following packages contain the source at the same revision as the above binaries:
- pypy-2.0.2-src.tar.bz2 (sources, Unix line endings)
- pypy-2.0.2-src.zip (sources, Unix line endings too, sorry)
Or you can checkout the current trunk using Mercurial (the trunk usually works and is of course more up-to-date):
hg clone https://bitbucket.org/pypy/pypy
Make sure you installed the dependencies. See the list here.
Enter the goal directory:
Run the rpython script. Here are the common combinations of options (works also with python instead of pypy):
pypy ../../rpython/bin/rpython -Ojit targetpypystandalone # get the JIT version pypy ../../rpython/bin/rpython -O2 targetpypystandalone # get the no-jit version pypy ../../rpython/bin/rpython -O2 --sandbox targetpypystandalone # get the sandbox version
Enjoy Mandelbrot :-) It takes on the order of half an hour to finish the translation, and 2.x GB of RAM on a 32-bit system and 4.x GB on 64-bit systems. (Do not start a translation on a machine with insufficient RAM! It will just swap forever. See notes below in that case.)
It is recommended to use PyPy to do translations, instead of using CPython, because it is twice as fast. You should just start by downloading an official release of PyPy (with the JIT). If you really have to use CPython then note that we are talking about CPython 2.5-2.7 here, not CPython 3.x.
If RAM usage is a problem (or if you are on Windows, because win32's limit is 2 GB unless you hack a lot), then you can (for now) tweak some parameters via environment variables and command-line options. The following command takes a bit more time, but finishes with only using 3.0 GB of RAM (on Linux 64-bit; probably not much more than 1.6 GB on 32-bit). It should be noted that it is less than with CPython.
PYPY_GC_MAX_DELTA=200MB pypy --jit loop_longevity=300 ../../rpython/bin/rpython -Ojit targetpypystandalone
Because of asmgcroot, compiling the generated C files containing the JIT is delicate. It requires using either MSVC or gcc with no particularly fancy options. It does not work e.g. with clang, or if you pass uncommon options with the CFLAGS environment variable. You can also try to compile PyPy with the shadow stack option.
Once PyPy is translated from source the binary package similar to those provided in the section Default (with a JIT Compiler) above could be easily created with package.py script as following:
cd ./pypy/pypy/tool/release/ python package.py ../../.. pypy-my-own-package-name
Here are the checksums for each of the downloads (md5 and sha1):
51ac0aa37a8255acbc71eca23ea29609 pypy-2.0.2-linux.tar.bz2 9d9f512ab2f114bfb4f165c71181a511 pypy-2.0.2-linux64.tar.bz2 a7da45a3161c198de6f662e3c40629ff pypy-2.0.2-osx64.tar.bz2 3e51dce7ecfc8fb069d65d95e8de6fb2 pypy-2.0.2-win32.zip b9c36b99296c85a590c3e480b05d5a13 pypy-2.0-alpha-arm-armel.tar.bz2 2565ce68b4032eb306d998e722495694 pypy-2.0-alpha-arm-armhf.tar.bz2 b39d98de75f4948bfd2d606a8263ac1f pypy-upstream_2.0~alpha+arm_armhf.deb 2c9f0054f3b93a6473f10be35277825a pypy-1.8-sandbox-linux64.tar.bz2 009c970b5fa75754ae4c32a5d108a8d4 pypy-1.8-sandbox-linux.tar.bz2 c26662e348159b460057548ddaf35333 pypy-2.0.2-src.tar.bz2 4da8c6dfbe7d2044d892c9bc20a649b0 pypy-2.0.2-src.zip c8ec9872fe823f4f7574620a5303c5b0f4576393 pypy-2.0.2-linux.tar.bz2 3d045ab7871bc478604cf1f16a3c4ec46c950e70 pypy-2.0.2-linux64.tar.bz2 a53de7bc88b9caa635d9d679c6e63813881ea7e9 pypy-2.0.2-osx64.tar.bz2 4ae8a35dd8043312199aacdbe3abb1a666fc9312 pypy-2.0.2-win32.zip dc09a293b85ab4f0032f6943815aaf5bbbceb645 pypy-2.0-alpha-arm-armel.tar.bz2 0971c4b668bfd2fcd52aa35087aa995e03bd5842 pypy-2.0-alpha-arm-armhf.tar.bz2 91910eb654ffbe0509bec2a7aeb460984acf8d82 pypy-upstream_2.0~alpha+arm_armhf.deb 895aaf7bba5787dd30adda5cc0e0e7fc297c0ca7 pypy-1.8-sandbox-linux64.tar.bz2 be94460bed8b2682880495435c309b6611ae2c31 pypy-1.8-sandbox-linux.tar.bz2 49e0af6e57bd2738cd3eb09c3246c69a3dc01319 pypy-2.0.2-src.tar.bz2 bfb23e7ea17cf9f2e9bf7f2211c6df3aeeafed32 pypy-2.0.2-src.zip