How to Install ray in Python

v2.54.1 General Purpose Python >=3.10 Apache 2.0

Ray provides a simple, universal API for building distributed applications.

Install pip install ray

What is ray?

Ray provides a simple, universal API for building distributed applications.

Ray is a unified framework for scaling AI and Python applications. Ray consists of a core distributed runtime and a set of AI libraries for simplifying ML compute:

- : Scalable Datasets for ML - : Distributed Training - : Scalable Hyperparameter Tuning - : Scalable Reinforcement Learning - : Scalable and Programmable Serving

- : Stateless functions executed in the cluster. - : Stateful worker processes created in the cluster. - : Immutable values accessible across the cluster.

Quick Start

Minimal example to get started with ray:

import ray

print(ray.__version__)

Installation

pip (standard)

pip install ray

Virtual environment (recommended)

python -m venv venv
source venv/bin/activate   # Windows: venv\Scripts\activate
pip install ray

pip3

pip3 install ray

conda

conda install -c conda-forge ray

Poetry

poetry add ray

Dependencies

Installing ray will also install these packages:

Verify the Installation

After installing, confirm the package is available:

python -c "import ray; print(ray.__version__)"

If this prints a version number, installation succeeded. If you see a ModuleNotFoundError, see the errors section below.

Installation Errors

Common errors when installing ray with pip.

ModuleNotFoundError: No module named 'ray'

Cause: The package is not installed in the current Python environment.

Fix: Run pip install ray. If using a virtual environment, ensure it is activated first.

ModuleNotFoundError: No module named 'ray' (installed but still failing)

Cause: pip installed the package into a different Python than the one running your script.

Fix: Use python -m pip install ray to install into the interpreter you are running.

ImportError: cannot import name 'X' from 'ray'

Cause: The function or class does not exist in the installed version.

Fix: Check the version with pip show ray and upgrade with pip install --upgrade ray.

pip: command not found

Cause: pip is not in PATH or Python was not added to PATH during installation.

Fix: Try python -m pip install ray. On macOS/Linux try pip3.

PermissionError: [Errno 13] Permission denied

Cause: No write access to the system Python package directory.

Fix: Use a virtual environment, or add --user: pip install --user ray

SSL: CERTIFICATE_VERIFY_FAILED

Cause: pip cannot verify PyPI's SSL certificate — common behind corporate proxies.

Fix: Try: pip install --trusted-host pypi.org --trusted-host files.pythonhosted.org ray

Recent Releases

VersionReleased
2.54.1 latest 2026-03-25
2.54.0 2026-02-18
2.53.0 2025-12-20
2.51.2 2025-11-29
2.52.1 2025-11-28

Full release history on PyPI →

Manage ray

Upgrade to latest version

pip install --upgrade ray

Install a specific version

pip install ray==2.54.1

Uninstall

pip uninstall ray

Check what is installed

pip show ray

Last updated: 2026-04-11 • Data from PyPI