rpy2
Python interface to the R language (embedded R)
Decision gist · record as of 2026-08-14
Yes, if you need R's capabilities within Python and your project can accept GPL-2.0-or-later licensing. The package is actively maintained, has low install friction (wheel available), and works with modern Python versions (3.9 through 3.13). Not suitable for proprietary projects due to copyleft licensing. Requires R to be installed separately on your system.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- R must be installed and in your system PATH; rpy2-rinterface (a compiled C extension) requires a working R installation with accessible shared libraries.
- Low friction: pure Python wheel available.
- Requires R to be installed on your system and accessible in PATH; if R is in a non-standard location, you may need to set LD_LIBRARY_PATH before importing.
License · maintenance · safety
GPL-2.0-or-later (copyleft) — GPL-2.0-or-later (copyleft): any code that links rpy2 must be distributed under GPL-2.0 or later. Proprietary or permissively-licensed projects cannot use this package without accepting copyleft obligations.
last release 2026-03-27 (140 days) · last repo commit 2026-03-26 · 702 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 385,556 downloads/mo, #7,061 on PyPI
Alternatives
Verify before relying
pip install rpy2
from rpy2.robjects import r
result = r('some_r_code')- Whether optional dependencies (numpy, pandas, ipython) are needed for typical workflows or only for specific use cases.
- Performance characteristics when calling R functions repeatedly from Python in tight loops.
What it is and what it does
rpy2 is a Python-to-R bridge that embeds an R interpreter within Python, letting you execute R code and manipulate R objects from Python without spawning a separate process. It wraps R's C API through rpy2-rinterface and provides high-level object bindings via rpy2-robjects, making it possible to mix R's statistical and data-manipulation capabilities directly into Python workflows.
The package is designed for data scientists and researchers who need R's specialized libraries but want to work within a Python environment. It requires R to be installed on your system and handles the bridging between Python and R's runtime, including memory management and type conversion. Installation is straightforward for standard setups, though non-standard R installations may require environment configuration.
Use it for
- Call R statistical functions and models from Python without leaving your Python environment or data pipeline.
- Use R's specialized packages to process or visualize data already in Python.
- Prototype data analysis workflows that combine Python libraries with R capabilities in a single script.
- Convert between Python objects and R objects for interoperability.
- Embed R computations in Python applications where R's domain expertise is needed but Python is the primary language.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you need R's capabilities within Python and your project can accept GPL-2.0-or-later licensing.
The package is actively maintained, has low install friction (wheel available), and works with modern Python versions (3.9 through 3.13). Not suitable for proprietary projects due to copyleft licensing. Requires R to be installed separately on your system.
Install
rpy2 on PyPI
Before you install
Low friction: pure Python wheel available. Requires R to be installed on your system and accessible in PATH; if R is in a non-standard location, you may need to set LD_LIBRARY_PATH before importing. Active maintenance with recent releases.
R must be installed and in your system PATH; rpy2-rinterface (a compiled C extension) requires a working R installation with accessible shared libraries.
License in practice
GPL-2.0-or-later (copyleft): any code that links rpy2 must be distributed under GPL-2.0 or later. Proprietary or permissively-licensed projects cannot use this package without accepting copyleft obligations.
Quickstart
pip install rpy2
from rpy2.robjects import r
result = r('some_r_code')
Verify before relying
- Whether optional dependencies (numpy, pandas, ipython) are needed for typical workflows or only for specific use cases.
- Performance characteristics when calling R functions repeatedly from Python in tight loops.
Package facts
| License | GPL-2.0-or-later copyleft |
| Python support | Supports the current Python release >=3.9 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 3 packagesrpy2-rinterfacerpy2-robjectspackaging |
| Maintenance | Actively maintained 140 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 385,556 / month, #7,061 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Intended Audience :: DevelopersIntended Audience :: Science/ResearchProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.9 |
Evidence: rpy2-3.6.7-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “statistical computing python”
- rpy2rpy2 embeds R within Python, allowing you to call R functions and…
- pytensor-distributionsPyTensor-distributions provides a collection of probability…
- tabmatProvides efficient matrix classes for tabular data that mix dense,…
Give your agent the search over MCP, or paste the wish link into any chat.
More Scientific/Engineering packages
NumPy provides an N-dimensional array object and a comprehensive suite of mathematical, linear algebra, Fourier transform, and random number functions for scientific computing in Python.
pandas provides fast, flexible data structures (Series and DataFrame) for loading, cleaning, transforming, and analyzing labeled or relational data in Python.
scipy provides numerical algorithms for mathematics, science, and engineering—including optimization, integration, linear algebra, Fourier transforms, signal and image processing, and ODE solvers—built on numpy arrays.
scikit-learn provides a comprehensive Python library for supervised and unsupervised machine learning, including classification, regression, clustering, dimensionality reduction, and model evaluation tools built on NumPy and SciPy.
Install it if you need to train, evaluate, or deploy supervised or unsupervised learning models.
dill extends Python's pickle module to serialize and deserialize a much wider range of Python objects, including functions, lambdas, classes, and interpreter sessions, to byte streams for storage or network transmission.
Multiprocess is an enhanced fork of Python's standard multiprocessing library that uses dill for better serialization, allowing you to spawn processes with a threading-like API and share complex objects between them.
Install it if you use multiprocessing and encounter pickle serialization limits with lambdas or complex objects.
See also rpy2-rinterface · rpy2-robjects · jupyter · jupyter-sphinx · pylink-square · mpi4py · widgetsnbextension · asteval · prince · pyreadr