Commercial enterprise offerings

Reticulate 1.41: Simplifying Python Installation and Package Management

Written by Tomasz Kalinowski
2025-03-03
reticulate logo plus the uv logo

One of the biggest hurdles for newcomers to Python isn’t learning the language—it’s installing it. Managing Python environments can be confusing and time-consuming, even for experienced users. With Reticulate version 1.41, we’re introducing a new approach that eliminates the need for manual installation and environment management. Our goal is to make working with Python in R as seamless as loading an R package.

We are excited to announce that Reticulate 1.41 is now available on CRAN. This update introduces py_require(), a new way to declare Python dependencies directly in your R scripts or packages. With the help of uv, Reticulate will automatically create and manage Python environments behind the scenes so you don’t have to.

Automatic Python management with py_require()

Gone are the days of manually setting up virtual environments. Instead of worrying about Python installations, you can now simply declare your dependencies using py_require(), and Reticulate will handle the rest.

Why is it so easy? Meet uv

This seamless experience is powered by uv, an extremely fast Python package manager written in Rust. uv can create virtual environments 10x–100x faster than traditional tools like venv and pip. Thanks to this performance boost, Reticulate can dynamically generate environments on demand, making manual setup a thing of the past.

How to use py_require()

In R scripts

When you load keras3, it calls py_require(), ensuring all necessary Python packages are installed and available. On the first run, everything just works.

library(keras3)  # Automatically declares and installs Python dependencies

For scripts that require specific Python packages, you can declare them directly:

library(reticulate)  
py_require("jax")   # Declare that we'll be using JAX
py_require("scipy") # Declare that we'll be using SciPy

jax <- import("jax")     # Use JAX  
scipy <- import("scipy") # Use SciPy  

This approach simplifies workflow, eliminating the need for pre-configured environments or system-wide installations.

In an R Package’s .onLoad()

Package authors can also take advantage of py_require() to ensure dependencies are automatically installed when their package is loaded:

.onLoad <- function(...) {  
  reticulate::py_require("scipy")  
}

This ensures that users don’t need to manually install Python dependencies—everything is handled automatically!

A new chapter for Python in R

With Reticulate 1.41, Python environment management becomes effortless. No more manually installing Python, configuring virtual environments, or maintaining complex setup scripts. Simply declare your requirements, and Reticulate—powered by uv—does the rest.

If you’ve been managing Python environments manually, I encourage you to try a different approach. With Reticulate 1.41, there’s no need for RETICULATE_PYTHON, custom setup scripts, or self-managed virtual environments. Give py_require() a chance and experience how seamless Python integration in R can be. Let go of the hassle and enjoy a smoother workflow—no more manual setup required.

Learn more about reticulate

📖 py_require() Reference
📖 Installing Python Packages in R Scripts
📖 Using Reticulate in an R Package