Download and install

There are nightly binary builds available. Those builds are not always as stable as the release, but they contain numerous bugfixes and performance improvements.

We provide binaries for x86, ARM, and PPC Linux, Mac OS/X and Windows for:

  • the Python2.7 compatible release — PyPy2.7 v5.3.1 — (what's new in PyPy2.7? and release note for PyPy2.7-v5.3.1)
  • the Python3.3 compatible release — PyPy3.3 v5.2-alpha — (what's new in PyPy3.3?).
  • the Python2.7 Software Transactional Memory special release — PyPy-STM 2.5.1 (Linux x86-64 only)

“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.

Linux binaries and common distributions

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. There are better solutions:

Python2.7 compatible PyPy 5.3.1

Python 3.3.5 compatible PyPy3.3 v5.2

Warning: this is an alpha release supporting the Python 3.3 language. It's also known to be (sometimes much) slower than PyPy 2.

If your CPU is really, really old, it may be a x86-32 without SSE2. There is untested support for manually translating PyPy's JIT without SSE2 (--jit-backend=x86-without-sse2) but note that your machine is probably low-spec enough that running CPython on it is a better idea in the first place.

[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, you will probably see: pypy: error while loading shared libraries: …. Unless you want to hack a lot, try out the portable Linux binaries.

PyPy-STM 2.5.1

This is a special version of PyPy! See the Software Transactional Memory (STM) documentation.

Other versions

The other versions of PyPy are:

  • The most up-to-date nightly binary builds 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/pypy2-5.3.1/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.

Installing more modules

The recommended way is to install pip, which is the standard package manager of Python. It works like it does on CPython. One practical difference, though, is that it usually comes pre-packaged for you when you get CPython from a place like your Linux distribution. In the case of PyPy (or CPython if you download it from http://www.python.org/), you need to get it separately, as explained in our FAQ.

Installing NumPy

NumPy is an exception to the rule that most packages work without changes. The “numpy” module needs to be installed from our own repository rather than from the official source.

If you have pip:

pypy -m pip install git+https://bitbucket.org/pypy/numpy.git

Alternatively, the direct way:

git clone https://bitbucket.org/pypy/numpy.git
cd numpy
pypy setup.py install

If you installed to a system directory, you need to also run this once:

sudo pypy -c 'import numpy'

Note that NumPy support is still a work-in-progress, many things do not work and those that do may not be any faster than NumPy on CPython. For further instructions see the pypy/numpy repository.

Building from source

  1. Get the source code. The following packages contain the source at the same revision as the above binaries:

    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
    

    The above command may take a long time to run and if it aborts, it is not resumable. You may prefer this way:

    hg clone -r null https://bitbucket.org/pypy/pypy
    cd pypy
    hg unbundle http://buildbot.pypy.org/bundle/pypy-bundle-01.bz2
    hg unbundle http://buildbot.pypy.org/bundle/pypy-bundle-02.bz2
    hg unbundle http://buildbot.pypy.org/bundle/pypy-bundle-03.bz2
    hg unbundle http://buildbot.pypy.org/bundle/pypy-bundle-04.bz2
    hg unbundle http://buildbot.pypy.org/bundle/pypy-bundle-05.bz2
    hg unbundle http://buildbot.pypy.org/bundle/pypy-bundle-06.bz2
    hg unbundle http://buildbot.pypy.org/bundle/pypy-bundle-07.bz2
    hg unbundle http://buildbot.pypy.org/bundle/pypy-bundle-08.bz2
    hg unbundle http://buildbot.pypy.org/bundle/pypy-bundle-09.bz2
    hg pull
    hg update
    

    If needed, you can also download the bz2 files by other means. You can then replace the multiple unbundle commands above with a single hg unbundle pypy-bundle-*.bz2.

  2. Make sure you installed the dependencies. See the list here.

  3. Enter the goal directory:

    cd pypy/pypy/goal
    
  4. Run the rpython script. Here are the common combinations of options (works also with python instead of pypy; requires Python 2.x or PyPy 2):

    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
    
  5. Enjoy Mandelbrot :-) It takes on the order of half an hour to finish the translation, and about 3GB of RAM on a 32-bit system and about 5GB 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.)

  6. If you want to install this PyPy as root, please read the next section, Packaging.

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.7 here, not CPython 3.x. (Older versions like 2.6 are out.)

  • On some 32-bit systems, the address space limit of 2 or 3 GB of RAM can be an issue. More generally you may be just a little bit low of RAM. First note that 2 GB is really not enough nowadays; on Windows you first need to refer to the Windows build instructions. More precisely, translation on 32-bit takes at this point 2.7 GB if PyPy is used and 2.9 GB if CPython is used. There are two workarounds:

    1. use PyPy, not CPython. If you don't have any PyPy so far, not even an older version, then you need to build one first, with some parts removed. So, first translate with ...rpython -Ojit targetpypystandalone --withoutmod-micronumpy --withoutmod-cpyext, then copy pypy-c and libpypy_c.so somewhere else, and finally call it with ...pypy-c ../../rpython/bin/rpython -Ojit.

    2. if even using PyPy instead of CPython is not enough, try to tweak some internal parameters. Example (slower but saves around 400MB):

    PYPY_DONT_RUN_SUBPROCESS=1 PYPY_GC_MAX_DELTA=200MB pypy --jit loop_longevity=300 ../../rpython/bin/rpython -Ojit --source
    # then read the next point about --source
    
  • You can run translations with --source, which only builds the C source files (and prints at the end where). Then you can cd there and execute make. This is another way to reduce memory usage. Note that afterwards, you have to run manually pypy-c .../pypy/tool/build_cffi_imports.py if you want to be able to import the cffi-based modules.

  • On Linux, because of asmgcroot, compiling the generated C files is delicate. It requires using 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. If you insist on passing these options or using clang, then you can compile PyPy with the shadow stack option instead (for some performance price in non-JITted code).

  • Like other JITs, PyPy doesn't work out of the box on some Linux distributions that trade full POSIX compliance for extra security features. E.g. with PAX, you have to run PyPy with paxctl -cm. This also applies to translation (unless you use CPython to run the translation and you specify --source).

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 --help #for information
python package.py --archive-name pypy-my-own-package-name

It is recommended to use package.py because custom scripts will invariably become out-of-date. If you want to write custom scripts anyway, note an easy-to-miss point: some modules are written with CFFI, and require some compilation. If you install PyPy as root without pre-compiling them, normal users will get errors:

  • PyPy 2.5.1 or earlier: normal users would see permission errors. Installers need to run pypy -c “import gdbm” and other similar commands at install time; the exact list is in package.py. Users seeing a broken installation of PyPy can fix it after-the-fact if they have sudo rights, by running once e.g. sudo pypy -c "import gdbm.
  • PyPy 2.6 and later: anyone would get ImportError: no module named _gdbm_cffi. Installers need to run pypy _gdbm_build.py in the lib_pypy directory during the installation process (plus others; see the exact list in package.py). Users seeing a broken installation of PyPy can fix it after-the-fact, by running pypy /path/to/lib_pypy/_gdbm_build.py. This command produces a file called _gdbm_cffi.pypy-26.so locally, which is a C extension module for PyPy. You can move it at any place where modules are normally found: e.g. in your project's main directory, or in a directory that you add to the env var PYTHONPATH.

Checksums

Here are the checksums for each of the downloads

pypy2.7-v5.3 md5:

05078bcdd797a025223d5905e2a12332  pypy2-v5.3.0-linux32.tar.bz2
7d01e12eaca473258801faebc2db12d8  pypy2-v5.3.0-linux64.tar.bz2
bf1640973865c5ca1bc88e299455cbcc  pypy2-v5.3.0-linux-armel.tar.bz2
2aa5941a05d46427293d48d67d079df5  pypy2-v5.3.0-linux-armhf-raring.tar.bz2
9c2cc832ba15fd4a08ba7e676226f406  pypy2-v5.3.0-linux-armhf-raspbian.tar.bz2
21a346cca4e8e6897381a0e647a86d68  pypy2-v5.3.0-osx64.tar.bz2
c39a578078ab3145d2a584cacf4c164c  pypy2-v5.3.0-s390x.tar.bz2
45ce35a438ed8ae1539cc05407d43965  pypy2-v5.3.0-src.tar.bz2
24add66f18ab2213c9e44af0ada61085  pypy2-v5.3.0-src.zip
f6197adf58bfa32bcb18451289da1c7c  pypy2-v5.3.0-win32.zip

pypy2.7-v5.3.1 md5:

0ff0e50e9595448d882fe94ab8667993  pypy2-v5.3.1-linux32.tar.bz2
41979b51bd5d8f9d6475b6478cf38992  pypy2-v5.3.1-linux64.tar.bz2
0f929b98566b154473a50820a3a6cbcf  pypy2-v5.3.1-linux-armel.tar.bz2
06ff729d3e30a9787ede69f327534d13  pypy2-v5.3.1-linux-armhf-raring.tar.bz2
be714716068e0e0c215e897f7c45ab34  pypy2-v5.3.1-linux-armhf-raspbian.tar.bz2
ae7c15c8b831847f359f673e3461b4e6  pypy2-v5.3.1-osx64.tar.bz2
a74f104c25aeb69d2eb2cdce01a2cb02  pypy2-v5.3.1-s390x.tar.bz2
2ebc87d24018c60cbf339de039dfecb0  pypy2-v5.3.1-src.tar.bz2
a1bbafb57c26de5aae8700cd7667a86b  pypy2-v5.3.1-src.zip
38e7d4dd33ea636cc7faebdd94ef6cb4  pypy2-v5.3.1-win32.zip

pypy3.3-v5.2-alpha md5:

1176464541dff42e685bf8a9bb393796  pypy3.3-v5.2.0-alpha1-linux32.tar.bz2
dc893175a5cae269017bb89637c3f260  pypy3.3-v5.2.0-alpha1-linux64.tar.bz2
dd741fd946c4d80486a333b89a6fe555  pypy3.3-v5.2.0-alpha1-linux-armel.tar.bz2
c2ff2f04a88415ea10e51e47a3ed19e6  pypy3.3-v5.2.0-alpha1-linux-armhf-raring.tar.bz2
fede8d6612f921967cd91bfbfaa448ea  pypy3.3-v5.2.0-alpha1-linux-armhf-raspbian.tar.bz2
e1cfcd84dab5ded374802231c3e6f9f2  pypy3.3-v5.2.0-alpha1-osx64.tar.bz2
08b9b4dc0ab11fa22f0fc57ba9a62d2b  pypy3.3-v5.2.0-alpha1-s390x.tar.bz2
e4bbd6fe42481a17f705611d76914eda  pypy3.3-v5.2.0-alpha1-src.tar.bz2
49402ad4c853e15e749514649b59220d  pypy3.3-v5.2.0-alpha1-src.zip

pypy-1.8 sandbox md5:

2c9f0054f3b93a6473f10be35277825a  pypy-1.8-sandbox-linux64.tar.bz2
009c970b5fa75754ae4c32a5d108a8d4  pypy-1.8-sandbox-linux.tar.bz2

pypy2.7-5.3 sha1:

401066f82c8a26dfb1e3421ae4b117655b55ee8d  pypy2-v5.3.0-linux32.tar.bz2
939a49319ed8e25ecb9f646ba50f0618eb52c99b  pypy2-v5.3.0-linux64.tar.bz2
00fe6e6d672c65d9096b45a708a1be95bca412c4  pypy2-v5.3.0-linux-armel.tar.bz2
08fd47ffdf3bc9b7409147e9a0a576e0d577d735  pypy2-v5.3.0-linux-armhf-raring.tar.bz2
1572762c5b76a6efda27110267f165bf9b78402d  pypy2-v5.3.0-linux-armhf-raspbian.tar.bz2
6d6219b7d42b6f31118d2ace2280932dd52d4d9d  pypy2-v5.3.0-osx64.tar.bz2
1d4f5f547d798294755fc9e14e2b6490e8a5d194  pypy2-v5.3.0-s390x.tar.bz2
7bdb1cfc604192fc2a39023588d648a30975f0e4  pypy2-v5.3.0-src.tar.bz2
18a81c46b3d0ecf7e186c19a7d302986a5b15a83  pypy2-v5.3.0-src.zip
076251ba3b44435dc11867dab00f392b058bdc7c  pypy2-v5.3.0-win32.zip

pypy2.7-5.3.1 sha1:

46dcd486ce2acbdf1815b29d70295ad305b667c5  pypy2-v5.3.1-linux32.tar.bz2
a06eba349f6346dd6ab4c47f9dcccb0b42986478  pypy2-v5.3.1-linux64.tar.bz2
60f33190bae1ac774f461b1da8f974ba1e8c0c24  pypy2-v5.3.1-linux-armel.tar.bz2
3fd2fa66437ce72c179ea76522407cde74456e36  pypy2-v5.3.1-linux-armhf-raring.tar.bz2
3f7f2aea02e90c6f4a5da00588cd06fdb74aa406  pypy2-v5.3.1-linux-armhf-raspbian.tar.bz2
1d866608f21a465f58ec6f9003f837262f6f7b1a  pypy2-v5.3.1-osx64.tar.bz2
08a31fe87ea99864780db86bdb7d7fb9029dc54c  pypy2-v5.3.1-s390x.tar.bz2
3abd0c4d133fde7198bf81b15b7786e4e3de9f9f  pypy2-v5.3.1-src.tar.bz2
fbfaba410f5031041907a28452cfd5e46b8a7336  pypy2-v5.3.1-src.zip
2963d6b1a87f284dfc0336cbec4c37eeb1918f41  pypy2-v5.3.1-win32.zip

pypy3.3-v5.2-alpha sha1:

03c1181f3866b977598e56b4263c8373d3f3a712  pypy3.3-v5.2.0-alpha1-linux32.tar.bz2
ae62d0df060e245b30eb07f12c5bc2260695ac36  pypy3.3-v5.2.0-alpha1-linux64.tar.bz2
cf09edf1232a7bbb475fb19c8e6080d590774c4e  pypy3.3-v5.2.0-alpha1-linux-armel.tar.bz2
3bec09a599371d0aca5408022a9ff4600f801e78  pypy3.3-v5.2.0-alpha1-linux-armhf-raring.tar.bz2
addfd4466e4dead5a4e620214a015a314bfee83e  pypy3.3-v5.2.0-alpha1-linux-armhf-raspbian.tar.bz2
f4a3badfe4c70465e9a2a43fde19e7a92975bc20  pypy3.3-v5.2.0-alpha1-osx64.tar.bz2
eb630112d27063ba336b1d11d083edcda98c3a1f  pypy3.3-v5.2.0-alpha1-s390x.tar.bz2
4b31ab492716ea375dd090bbacdf3d7c2d483059  pypy3.3-v5.2.0-alpha1-src.tar.bz2
d9f5b64f144ebec1a200156809fbbe04fdf7eb7e  pypy3.3-v5.2.0-alpha1-src.zip

pypy2.7-5.3 sha256:

bd422fe9d0b7d525d1da3f32855b047bc39ba397d0cf708d8f4f96fe874424f2  pypy2-v5.3.0-linux32.tar.bz2
ac336e8877ed676bf87a9a546d5926b6afc4679fa2d3fdf9f3ca56f28ec40588  pypy2-v5.3.0-linux64.tar.bz2
81b6f589a947d7353bb69408c46d4833d6e9cb501f3c3f0c73bd28d0e3df69aa  pypy2-v5.3.0-linux-armel.tar.bz2
bdb911a87e773a292334061b9c33b907f46d987e403fe94cc627a3b9b1c9cb19  pypy2-v5.3.0-linux-armhf-raring.tar.bz2
87b3566b6bbb8bf31c2f0d72bf31d95142fdce004d987812336a59d788005bed  pypy2-v5.3.0-linux-armhf-raspbian.tar.bz2
1b103bacbdcdbbc490660ec0c7b3d99d1ff1cfc2f13cd403db21c27f03d36a1d  pypy2-v5.3.0-osx64.tar.bz2
1ccc0ce08dd55d188d3971331020a1c82e917e418846d2c2c07a225733d85b1e  pypy2-v5.3.0-s390x.tar.bz2
4142eb8f403810bc88a4911792bb5a502e152df95806e33e69050c828cd160d5  pypy2-v5.3.0-src.tar.bz2
09914006c2c5c394bb6f847f6eb9c9322737c7238e7ca482c5a12c9e2ef76a58  pypy2-v5.3.0-src.zip
32a9e5286fc344165f63b529a9f84e521e9368e717c583488115654676428a20  pypy2-v5.3.0-win32.zip

pypy2.7-5.3.1 sha256:

da69f4280b288e524387103eaa3eb4d036965724c3e546da27135c15a77bd2eb  pypy2-v5.3.1-linux32.tar.bz2
6d0e8b14875b76b1e77f06a2ee3f1fb5015a645a951ba7a7586289344d4d9c22  pypy2-v5.3.1-linux64.tar.bz2
0425f2022c35ef7f0bb3d2b854c5bcbe500b1aba511a0d83581ba6c784913961  pypy2-v5.3.1-linux-armel.tar.bz2
b4859496099bde4b17c1e56cc5749dcdcd25b4c68fde1d2ea426de84130e84cc  pypy2-v5.3.1-linux-armhf-raring.tar.bz2
5c93eb3c54fbb2c7d7332f775a096671512e590565e6051196bbc5039c5033b5  pypy2-v5.3.1-linux-armhf-raspbian.tar.bz2
7a242d7373b4f18c7f5fe6c2fe6f15e2a405d9adf1f4f934c89b875e60ac5def  pypy2-v5.3.1-osx64.tar.bz2
61262f0727ee04b225761b59ce270a64fae9b986d22405a93340f05d0d5c0e0e  pypy2-v5.3.1-s390x.tar.bz2
31a52bab584abf3a0f0defd1bf9a29131dab08df43885e7eeddfc7dc9b71836e  pypy2-v5.3.1-src.tar.bz2
7eab4a8435583750088001d88371cd0314999b67f26f32ab9d006802f0beec2e  pypy2-v5.3.1-src.zip
d83477e2c5f032ebd8c7f47afce03dc8adbeb41a3c74f7db50d9de317dcf3a4a  pypy2-v5.3.1-win32.zip

pypy3.3-v5.2-alpha sha256:

351aec101bdedddae7ea1b63845a5654b1a95fc9393894ef84a66749f6945f17  pypy3.3-v5.2.0-alpha1-linux32.tar.bz2
f5e66ab24267d6ddf662d07c512d06c10ebc732ae62093dabbd775ac63b9060a  pypy3.3-v5.2.0-alpha1-linux64.tar.bz2
ac83e632213f078ab60045e6ad0564b146d65dcd9a52c130026fab6dd85bf2dc  pypy3.3-v5.2.0-alpha1-linux-armel.tar.bz2
b4d847d33c1bf9b3956d1d17b9e37505eb32f68e341c9333a74a82010a63e799  pypy3.3-v5.2.0-alpha1-linux-armhf-raring.tar.bz2
ba9a5d0cbac1c622363315b30df288ab2cf8fcccf7e2882bf5946115dbfa657e  pypy3.3-v5.2.0-alpha1-linux-armhf-raspbian.tar.bz2
abaceab5d2790f49e04e0d80669283da41f94b77cf483b30ac0de48d3c19f304  pypy3.3-v5.2.0-alpha1-osx64.tar.bz2
b0422f4122c214d37d5a2f0f2cc95e3f823bf653e39d742e7de3c8c406c11399  pypy3.3-v5.2.0-alpha1-s390x.tar.bz2
344c2f088c82ea1274964bb0505ab80d3f9e538cc03f91aa109325ddbaa61426  pypy3.3-v5.2.0-alpha1-src.tar.bz2
d31eafa86fa57f70a89ae670e19be08765c0678443a076076eff206160d0594c  pypy3.3-v5.2.0-alpha1-src.zip

pypy-1.8 sandbox sha1:

895aaf7bba5787dd30adda5cc0e0e7fc297c0ca7  pypy-1.8-sandbox-linux64.tar.bz2
be94460bed8b2682880495435c309b6611ae2c31  pypy-1.8-sandbox-linux.tar.bz2