Skip to content

Support bundled ipykernel for reticulate sessions - #1404

Merged
t-kalinowski merged 2 commits into
mainfrom
feature/reticulate-bundled-ipykernel
Sep 18, 2026
Merged

t-kalinowski merged 2 commits into
mainfrom
feature/reticulate-bundled-ipykernel

Conversation

@t-kalinowski

@t-kalinowski t-kalinowski commented Sep 10, 2026 •

Copy link
Copy Markdown
Member

Python (reticulate) sessions can fail to start when the project's Python environment lacks ipykernel, even when the user's code doesn't depend on it. Users see an error about positron_ipykernel, as reported in this comment.

Positron already ships ipykernel. This adds the Ark support needed to make that bundled copy available to reticulate. Ark reports which Python version and architecture are running inside R, then accepts the locations of the matching packages before starting the kernel.

A companion Positron PR posit-dev/positron#16045 supplies those locations. Existing callers can omit them and continue using packages installed in their Python environment.

Report the embedded interpreter without importing ipykernel. Accept
optional import paths in the kernel-start RPC and prepend them before
launching the kernel.

Add opt-in integration coverage for project environments with bundled
packages and managed environments with and without the bundle.
Keep the Ark change focused on interpreter metadata and kernel import
paths. The full Positron bundle startup integration does not belong here.
{
# PYTHONPATH cannot change an already initialized interpreter. Apply
# the launcher's paths directly, preserving their precedence.
sys <- reticulate::import("sys", convert = FALSE)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reticulate is wild to watch in action

@t-kalinowski
t-kalinowski merged commit bc7680f into main Sep 18, 2026
17 checks passed
@t-kalinowski
t-kalinowski deleted the feature/reticulate-bundled-ipykernel branch September 18, 2026 16:00
@github-actions github-actions Bot locked and limited conversation to collaborators Sep 18, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants