Easy install PyPy3

less than 1 minute read

PyPy allows running Python code up to multiple times faster. Not all packages are supported, but it can be worth a try, particularly for heavy “pure Python” workloads.

  1. download PyPy3 as matching your operating system. Extract to your home directory.
  2. make a softlink so that pypy3 will just work:
    ln -s ~/pypy3-*-linux64/bin/pypy3 ~/.local/bin
    
  3. Install/upgrade basic tools
    pypy3 -m ensurepip
    pypy3 -m pip install -U pip setuptools wheel
    
  4. The standard Numpy is recommended over deprecated NumPyPy:
    pypy3 -m pip install numpy
    

Some things don’t work yet easily, like mypy but give PyPy3 a go and see if it will speed up your workload.

Tags:

Categories:

Updated:

Leave a comment