rpy2-robjects
Python interface to the R language (embedded R)
What it is and what it does
rpy2-robjects is the object-oriented layer of the rpy2 Python-to-R bridge, built on top of rpy2-rinterface. It allows Python code to call R functions, manipulate R objects, and work with R data structures as if they were native Python objects. The package depends on rpy2-rinterface, jinja2, tzlocal, and packaging.
Typical use involves importing R functions or running R code snippets from within Python scripts, making it useful for data analysis workflows that combine Python and R. The package supports Python 3.9, 3.10, 3.11, 3.12, and 3.13, and is actively maintained. Installation is straightforward via pip, though it requires a working R installation on the system and may need library path configuration if R is not in a standard location.
Use it for:
- Call R statistical functions and packages from Python without leaving your Python environment.
- Combine Python data processing with R's statistical modeling and visualization capabilities.
- Prototype or migrate R code to Python incrementally by running R functions directly.
- Access R objects and data structures in Python for further manipulation or integration.
- Build Python applications that leverage specialized R packages not available in Python.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides a Python interface to call R code and access R objects directly from Python, enabling interoperability between the two languages.
Yes, if you need to call R from Python and have R already installed on your system. The package is actively maintained, has low install friction, and carries no known vulnerabilities. The GPLv2+ copyleft license requires careful consideration if you plan to distribute your code—ensure your project's license is compatible. The main blocker is the external R dependency and potential library path configuration on non-standard R installations.
Install
rpy2-robjects on PyPI
pip
pip install rpy2-robjectsuv
uv add rpy2-robjectspoetry
poetry add rpy2-robjectsInstalling rpy2-robjects
Before you install
Low install friction with a pure-wheel distribution. Actively maintained with recent commits and releases. Requires R to be installed and accessible on the system; if R is not in a standard location, library path configuration may be needed.
License in practice
Released under GPLv2+, a copyleft license. Any code that links or distributes this package must comply with GPL terms, including potential source code disclosure obligations.
Quickstart
pip install rpy2-robjects
from rpy2.robjects import r
result = r('sum')
R must be installed and accessible on the system; if R is not in a standard location, LD_LIBRARY_PATH may need to be configured before importing.
Verify before relying
- Whether rpy2-robjects works as a standalone package or requires the parent rpy2 package to be installed separately.
- Performance characteristics and overhead when calling R functions from Python in tight loops.
- Compatibility with specific R versions and whether version mismatches cause runtime failures.
Package facts
| License | GPLv2+ (copyleft) |
| Python support | supports the current Python release (>=3.9) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 4 — rpy2-rinterface, jinja2, tzlocal, packaging |
| Maintenance | actively maintained — 140 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 120,582/month — #12,018 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: rpy2_robjects-3.6.5-py3-none-any.whl
Tags
More Scientific/Engineering packages
NumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
pandaspandas provides fast, flexible data structures…
permissive · top 100 on PyPI
scipyscipy provides numerical algorithms for…
permissive · top 100 on PyPI
scikit-learnscikit-learn provides a comprehensive Python…
permissive · top 1,000 on PyPI
dilldill extends Python's pickle module to…
permissive · top 1,000 on PyPI
multiprocessMultiprocess is an enhanced fork of Python's…
permissive · top 1,000 on PyPI
rpy2rpy2 embeds R within Python, allowing you to…
copyleft · top 15,000 on PyPI
rpy2-rinterfacerpy2-rinterface provides a low-level…
copyleft · top 15,000 on PyPI
py4jPy4J enables Python programs to dynamically…
permissive · top 1,000 on PyPI
cwrapcwrap is a Python wrapper around C code that…
copyleft · top 15,000 on PyPI
pyobjcPyObjC bridges Python and Objective-C, enabling…
permissive · top 15,000 on PyPI
pyobjc-corePyObjC-core provides the foundational bridge…
permissive · top 5,000 on PyPI
pyuwsgipyuwsgi packages the uWSGI application server…
copyleft · top 15,000 on PyPI
cppyy-clingProvides Cling, an LLVM-based interactive C++…
copyleft · top 15,000 on PyPI
mpi4pympi4py provides Python bindings for the Message…
permissive · top 5,000 on PyPI
pylink-squareProvides a Python interface to control SEGGER…
permissive · top 5,000 on PyPI