Download and install
Here are the binaries of the current release — PyPy 2.0 — (what's new in PyPy 2.0?) for x86 Linux, Mac OS/X, Windows. ARM support in 2.0 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; for the most up-to-date version see below.)
2.0
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, 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 32bit Linux and 64bit Linux.
- Linux binary (32bit, tar.bz2 built on Ubuntu 10.04.4 LTS) (see [1] below)
- Linux binary (64bit, tar.bz2 built on Ubuntu 12.04.2 LTS) (see [1] 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)
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.
[1]: 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
Other versions
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.)
Installing
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/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-src.tar.bz2 (sources, Unix line endings)
- pypy-2.0-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:
cd pypy/pypy/goal
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.)
Notes:
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.
Packaging
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
Checksums
Here are the checksums for each of the downloads (md5 and sha1):
756d738d8f35924357150fe1b6d33f86 pypy-2.0-linux64.tar.bz2 267c46ed8c591da19b6091aa90fa9acf pypy-2.0-linux.tar.bz2 39837722da4a03ca03eda187aafa13bb pypy-2.0-osx64.tar.bz2 f0d051c2b612b64dff496a6c0f3654fb pypy-2.0-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 4dc82e2240dd2b5be313119672988538 pypy-2.0-src.tar.bz2 f965b50bc34c97891af77e6b743038f2 pypy-2.0-src.zip 88aacc21c6c552b3ff3a157a7575a9dca7e4a7c3 pypy-2.0-linux64.tar.bz2 b2e64ca5e38a59c3402185cca08ca5a4d507ff7e pypy-2.0-linux.tar.bz2 65ecb2ba570f05691978c64469cfe3e76bfd8e01 pypy-2.0-osx64.tar.bz2 cc3b37b5d59b88cf340c72aaae13dd2bb0337bcc pypy-2.0-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 d694824eeaa6169bce8d112149c9a5c7897534ed pypy-2.0-src.tar.bz2 dc44cc9141a729ccc39b98432062bbe29c938432 pypy-2.0-src.zip