Last modified: Jun 16, 2026

Install PyPy for Python Guide

PyPy is a fast, drop-in replacement for CPython. It uses a just-in-time (JIT) compiler to speed up Python code. Many developers see 4-5x speed boosts. This guide shows you how to install PyPy for Python on major operating systems.

You do not need to uninstall your existing Python. PyPy runs alongside it. You can use it for specific projects or as your default interpreter.

What is PyPy?

PyPy is a Python interpreter. It supports Python 3.10 and Python 3.11. It focuses on speed. The JIT compiler compiles hot code paths at runtime. This makes loops and math-heavy code much faster.

PyPy works with most Python libraries. Some C extensions may need special handling. Pure Python code runs without changes.

Benefits of Using PyPy

Speed is the main reason to install PyPy. It can run Python code 4-10 times faster than CPython. Memory usage is often lower too.

PyPy supports asyncio and async/await. It has a garbage collector that handles large objects well. It is a great choice for web servers, data processing, and scientific computing.

You can use PyPy with popular frameworks like Django, Flask, and NumPy (with some limitations).

How to Install PyPy on Windows

Installing PyPy on Windows is simple. Follow these steps:

Step 1: Download PyPy

Go to the official PyPy download page. Choose the Windows binary for your Python version. For example, pypy3.10-v7.3.16-win64.zip.

Step 2: Extract the Archive

Unzip the file to a folder. For example: C:\pypy. You can place it anywhere.

Step 3: Add to PATH

Add the PyPy folder to your system PATH. This lets you run pypy from any terminal.

Open System Properties > Advanced > Environment Variables. Edit the Path variable. Add the full path to your PyPy folder.

Step 4: Verify Installation

Open a new Command Prompt. Type:


pypy --version

You should see output like:


Python 3.10.14 (a5b4f9b8e7b2, Sep 11 2024, 09:43:12)
[PyPy 7.3.16 with MSC v.1929 64 bit (AMD64)]

How to Install PyPy on macOS

macOS users can install PyPy via Homebrew. It is the easiest method.

Step 1: Install Homebrew

If you do not have Homebrew, install it from brew.sh.

Step 2: Install PyPy

Open Terminal. Run:


brew install pypy3

Homebrew downloads and installs PyPy automatically.

Step 3: Verify Installation

Check the version:


pypy3 --version

Output example:


Python 3.10.14 (a5b4f9b8e7b2, Sep 11 2024, 09:43:12)
[PyPy 7.3.16 with GCC Apple LLVM 15.0.0]

How to Install PyPy on Linux

Linux users have several options. Package managers work best.

Option 1: Using APT (Debian/Ubuntu)

Update your package list. Then install PyPy:


sudo apt update
sudo apt install pypy3

Option 2: Using YUM/DNF (Fedora/RHEL)

For Fedora, use DNF:


sudo dnf install pypy3

Option 3: Manual Download

Download the Linux tarball from the PyPy website. Extract it to a folder. Add that folder to your PATH.

Verify Installation

Run:


pypy3 --version

Output example:


Python 3.10.14 (a5b4f9b8e7b2, Sep 11 2024, 09:43:12)
[PyPy 7.3.16 with GCC 12.2.0]

Using PyPy with pip

PyPy includes its own pip. Use it to install packages. This ensures compatibility.

Install a package with:


pypy3 -m pip install requests

You can list installed packages:


pypy3 -m pip list

Always use PyPy's pip, not the system pip. This avoids version conflicts.

Creating a Virtual Environment with PyPy

Virtual environments isolate project dependencies. PyPy works with venv.

Create a virtual environment:


pypy3 -m venv myproject_env

Activate it on Linux/macOS:


source myproject_env/bin/activate

On Windows:


myproject_env\Scripts\activate

Now you can install packages inside this environment. They will use PyPy.

Testing PyPy Speed

Let us test PyPy speed with a simple loop. Create a file test_speed.py:


import time

def compute_sum(n):
    total = 0
    for i in range(n):
        total += i ** 2
    return total

start = time.time()
result = compute_sum(10_000_000)
end = time.time()

print(f"Result: {result}")
print(f"Time: {end - start:.4f} seconds")

Run it with CPython first:


python test_speed.py

Output example:


Result: 333333283333335000000
Time: 2.3456 seconds

Now run it with PyPy:


pypy3 test_speed.py

Output example:


Result: 333333283333335000000
Time: 0.4567 seconds

PyPy is about 5x faster. The JIT compiler optimizes the loop.

Compatibility Considerations

Most pure Python code works with PyPy. Some C extensions may fail. NumPy and Pandas have PyPy-compatible versions. Check your libraries.

PyPy supports the ctypes module. You can use it to call C libraries directly.

If a package does not work, use CPython for that project. You can switch between interpreters easily.

Conclusion

Installing PyPy for Python is straightforward. It gives you a huge speed boost with minimal changes. Download it for your OS, add it to PATH, and start using it.

Use PyPy for performance-critical projects. Use CPython for full compatibility with C extensions. Both can coexist on your system.

Try PyPy today. Your code will run faster.