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:

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

Python 3.2.5 compatible PyPy3 2.4.0

Warning: this is (1) based on an old release of PyPy, and (2) only supporting the Python 3.2 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/pypy-5.1.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 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.)

  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

pypy-5.1.1 md5:

3fa98eb80ef5caa5a6f9d4468409a632  pypy-5.1.1-linux64.tar.bz2
1d5874f076d18ecd4fd50054cca0c383  pypy-5.1.1-linux-armel.tar.bz2
9e47e370d57293074bbef6c4c0c4736d  pypy-5.1.1-linux-armhf-raring.tar.bz2
b6643215abc92ed8efd94e6205305a36  pypy-5.1.1-linux-armhf-raspbian.tar.bz2
224e4d5870d88fb444d8f4f1791140e5  pypy-5.1.1-linux.tar.bz2
e35510b39e34f1c2199c283bf8655e5c  pypy-5.1.1-osx64.tar.bz2
9d8b82448416e0203efa325364f759e8  pypy-5.1.1-s390x.tar.bz2
7aff685c28941fda6a74863c53931e38  pypy-5.1.1-src.tar.bz2
ee9795d8638d34126ca24e4757a73056  pypy-5.1.1-src.zip
d70b4385fbf0a5e5260f6b7bedb231d4  pypy-5.1.1-win32.zip

pypy-5.1.0 md5:

17baf9db5200559b9d6c45ec8f60ea48  pypy-5.1.0-linux-armel.tar.bz2
c0f360b601cd723031c0edc18b62f118  pypy-5.1.0-linux-armhf-raring.tar.bz2
27e5e98ccbca5ebb5933147556a46f77  pypy-5.1.0-linux-armhf-raspbian.tar.bz2
224d1f124393c96c98b9acbaf4f92078  pypy-5.1.0-linux.tar.bz2
2a58aa928ae1cabc6a3309cf98f6182e  pypy-5.1.0-linux64.tar.bz2
7f546940acb3ceebb5967697a9b05b65  pypy-5.1.0-osx64.tar.bz2
f9362ffc2946efcaadcc40fdb2c43df7  pypy-5.1.0-s390x.tar.bz2
d0a76859c83fb0427674273977086cb2  pypy-5.1.0-src.tar.bz2
204273a21dbf71c0827966265c40eb7a  pypy-5.1.0-src.zip
a1710ae6f15b567bf3c8fd608553ad48  pypy-5.1.0-win32.zip

pypy3-2.4.0 md5:

eadbc9790823fc0ae40c943087cd7cb3  pypy3-2.4.0-linux64.tar.bz2
7ab84727da2d5363866907f2f7921d86  pypy3-2.4.0-linux-armel.tar.bz2
83158d3a55ca134b179ef01dc2bb6a30  pypy3-2.4.0-linux-armhf-raring.tar.bz2
b0b81cfa46e970c584bda10feebe1a85  pypy3-2.4.0-linux-armhf-raspbian.tar.bz2
68af7a6ca5948a1448a4b9c839d1472c  pypy3-2.4.0-linux.tar.bz2
c6cd12602469446db1dfa1e2bc6c699c  pypy3-2.4.0-osx64.tar.bz2
8514f16b1a6262828e824bd8b37607db  pypy3-2.4.0-win32.zip
96ba72916114d16904e12562b5d84e51  pypy3-2.4.0-src.tar.bz2
c58015d0d3e08a9f24b93b8edca26d4d  pypy3-2.4.0-src.zip

pypy-1.8 sandbox md5:

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

pypy-5.1.1 sha1:

9ffc1fe9dfeec77a705b0d1af257da7e87894f5a  pypy-5.1.1-linux64.tar.bz2
e432b157bc4cd2b5a21810ff45fd9a1507e8b8bf  pypy-5.1.1-linux-armel.tar.bz2
5ed85f83566a4de5838c8b549943cb79250386ad  pypy-5.1.1-linux-armhf-raring.tar.bz2
ddd1c20e049fcbc01f2bd9173ad77033540722a9  pypy-5.1.1-linux-armhf-raspbian.tar.bz2
6767056bb71081bce8fcee04de0d0be02d71d4f9  pypy-5.1.1-linux.tar.bz2
734eb82489d57a3b2b55d6b83153b3972dc6781d  pypy-5.1.1-osx64.tar.bz2
2440d613430f9dfc57bc8db5cfd087f1169ee2d0  pypy-5.1.1-s390x.tar.bz2
34eca157e025e65f9dc1f419fa56ce31ad635e9c  pypy-5.1.1-src.tar.bz2
95596b62cf2bb6ebd4939584040e713ceec9ef0a  pypy-5.1.1-src.zip
3694e37c1cf6a2a938c108ee69126e4f40a0886e  pypy-5.1.1-win32.zip

pypy-5.1.0 sha1:

114d4f981956b83cfbc0a3c819fdac0b0550cd82  pypy-5.1.0-linux-armel.tar.bz2
e3060f8fa765c317ec1ad6923f9ea595b9d411c3  pypy-5.1.0-linux-armhf-raring.tar.bz2
8943448afd1fd3e89be0575f69c6f3be69f2efbc  pypy-5.1.0-linux-armhf-raspbian.tar.bz2
229e7dbc130d2cc92be9d1cde88f2d6f7f28621b  pypy-5.1.0-linux.tar.bz2
c959524ce180f801bdbcbee4ca038309e1c771dd  pypy-5.1.0-linux64.tar.bz2
216a52e44f3642176cf05fc3b4c6e2cf8981e400  pypy-5.1.0-osx64.tar.bz2
b696059359a780ad3c2641b14c989021d93015e8  pypy-5.1.0-s390x.tar.bz2
c9c497836e6235af9fee2a98e4aeaa2bc3a29550  pypy-5.1.0-src.tar.bz2
a184ef5ada93d53e8dc4a9850a9ed764bd661d7b  pypy-5.1.0-src.zip
4daba0932afcc4755d93d55aa3cbdd851da9198d  pypy-5.1.0-win32.zip

pypy-5.1.1 sha256:

c852622e8bc81618c137da35fcf57b2349b956c07b6fd853300846e3cefa64fc  pypy-5.1.1-linux64.tar.bz2
062b33641c24dfc8c6b5af955c2ddf3815b471de0af4bfc343020651b94d13bf  pypy-5.1.1-linux-armel.tar.bz2
c4bcdabccd15669ea44d1c715cd36b2ca55b340a27b63e1a92ef5ab6eb158a8d  pypy-5.1.1-linux-armhf-raring.tar.bz2
fc2a1f8719a7eca5d85d0bdcf499c6ab7409fc32aa312435bcbe66950b47e863  pypy-5.1.1-linux-armhf-raspbian.tar.bz2
7951fd2b87c9e621ec57c932c20da2b8a4a9e87d8daeb9e2b7373f9444219abc  pypy-5.1.1-linux.tar.bz2
fe2bbb7cf95eb91b1724029f81e85d1dbb6025a2e9a005cfe7258fe07602f771  pypy-5.1.1-osx64.tar.bz2
4acd1066e07eb668665b302bf8e9338b6df136082c5ce28c62b70c6bb1b5cf9f  pypy-5.1.1-s390x.tar.bz2
99aff0c710c46903b821c7c436f9cb9de16bd7370d923f99cc7c28a66be6c5b2  pypy-5.1.1-src.tar.bz2
7c0c5157e7977674aa942de3c20ff0567f7af986824f6674e2424f6089c41501  pypy-5.1.1-src.zip
22a780e328ef053e098f2edc2302957ac3119adf7bf11ff23e225931806e7bcd  pypy-5.1.1-win32.zip

pypy-5.1.0 sha256:

ea7017449ff0630431866423220c3688fc55c1a0b80a96af0ae138dd0751b81c  pypy-5.1.0-linux-armel.tar.bz2
a3e13083591bccc301fb974ff0a6c7e4ab4e611e4b31c0932898b981c794462b  pypy-5.1.0-linux-armhf-raring.tar.bz2
3bfcd251b4f3fd1a09520b2741c647c364d16d50c82b813732a78ac60ccb2b69  pypy-5.1.0-linux-armhf-raspbian.tar.bz2
2f6c521b5b3c1082eab58be78655aa01ec400d19baeec93c455864a7483b8744  pypy-5.1.0-linux.tar.bz2
0e8913351d043a50740b98cb89d99852b8bd6d11225a41c8abfc0baf7084cbf6  pypy-5.1.0-linux64.tar.bz2
7e270c66347158dd794c101c4817f742f760ed805aa0d10abe19ba4a78a75118  pypy-5.1.0-osx64.tar.bz2
096827f2cb041f9decc5a2b0b8fc6b5fe0748f229b0419fd73982e0714a292cd  pypy-5.1.0-s390x.tar.bz2
16bab9501e942c0704abbf9cd6c4e950c6a76dc226cf1e447ea084916aef4714  pypy-5.1.0-src.tar.bz2
afc1c72651c90418b57692a5628481dd09a3d3172765fd206e8bcdac7b1bf02d  pypy-5.1.0-src.zip
044e7f35223a443412b5948740e60e93069a6f8b0a72053cc9d472874bb1b6cc  pypy-5.1.0-win32.zip
3373b1d51fc610b962e0b535087073f2cc921ab0269ba2896b140ab4a56588fd  pypy-5.0.1++-ppc64.tar.bz2
53d742504a78366b833c04bd83740336aa4ddfecffeff6b2fa8728fcd6b4c8af  pypy-5.0.1+-ppc64le.tar.bz2

pypy3-2.4.0 sha1:

7d715742f6929351b310a2ca3b924cab35913089  pypy3-2.4.0-linux64.tar.bz2
b33e817f3557f91c434032c9f74e5220fe70036c  pypy3-2.4.0-linux-armel.tar.bz2
bb098b72ecc83a0e73c426f364bb6a0974fb9360  pypy3-2.4.0-linux-armhf-raring.tar.bz2
775dc9f8073c4fad7cd220c4b5dd385e7be469e9  pypy3-2.4.0-linux-armhf-raspbian.tar.bz2
c39061f3e5e7a05548eb89c5cbd3ed81a795879f  pypy3-2.4.0-linux.tar.bz2
9f01d8c5e18c8c7d54fc6ab77dbf5673a65c2af9  pypy3-2.4.0-osx64.tar.bz2
2efca54daa4c5da23ef577d70006376e13cfb6b8  pypy3-2.4.0-win32.zip
438572443ae6f54eb6122d807f104787c5247e01  pypy3-2.4.0-src.tar.bz2
bd0a91cdda965f42c382bf00f4a2fb8677b929a6  pypy3-2.4.0-src.zip

pypy-1.8 sandbox sha1:

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