Positron is a new IDE developed by Posit. I’ve been putting off giving it a deep dive. I love RStudio. Maybe it’s the green icons, or the simple 4 box layout, or even just that it’s what I’ve been using for so long but it really feels like a happy place to me.
I was the same way with RMarkdown. You could have torn it from my cold dead hands, but eventually that feature comes along that makes going through the process of changing worth it. And for me with Quarto that was lightbox
with its ability to magically resize images. Such a simple thing, such a challenging thing to do outside of Quarto.
First impressions
Changing the theme made it feel like less of a sterile and “other” place. I’m a big fan of dark modes and I actually really liked the built in dark mode.
gear -> theme -> positron dark
There are some good resources for porting your own theme also: https://www.r-bloggers.com/2025/05/porting-my-favorite-rstudio-color-theme-to-positron/
Viewing data
My extensions
Since Positron is a fork of VS Code it relies on extensions for adding various features. Here are some of my favorites:
- Air (R Language Support)
- Posit Publisher
- Black Formatter
- Gitlive
- Pyright
- Jupyter
- Jupter Cell Tags
- Jupyter Keymap
- Jupyter Slide Show
- Project Manager
- Python Debugger
- Quarto
- Ruff
- Shiny
- Scope to this
- vscode-pets
Remote connections with SSH
This is bundled with Positron and there’s no need to install anything.
LLM integrations
Stay tuned for Posit::Conf 2025!
Running a python project
Reference: https://positron.posit.co/start.html
I’m a big fan of using the git integration to clone down a project, for example this set of demo examples.
We’ll want to make sure that ipykernel
is installed:
python3 -m pip install ipykernel
We can discover which python versions we have access to with:
ls /opt/python/
Select the python interpreter
Manage the interpreter in the session (virtual environment) through the top right icon:
Reference: https://positron.posit.co/managing-interpreters.html
You can also manually select the python interpreter with ctrl-shift-p
and then Python: Select Interpreter
command and select the Enter interpreter path...
option.
This gives you the ability to refresh the visible interpreters with the circle arrow symbol.
We can create a new interpreter (and then select it through the dropdown) either with uv or pip.
The uv way
Use uv. It will detect that this is a project and create the venv for us when we go to run the application.
Run the application:
uv run app.py
uv run shiny run --reload app.py
The pip way
Setup the venv
environment:
python -m venv env
. env/bin/activate
# source env/bin/activate
pip install --upgrade pip
pip install -r requirements.txt
I recommend using env
instead of .venv
because quarto will automatically pick it up.
Run the application:
shiny run --reload app.py
Register new interpreter as kernel (likely optional)
# Register as kernel
pip install ipykernel jupyter
# python -m ipykernel install --name "my-new-project_venv" --user
python -m ipykernel install --name "shiny-income-share" --user
Running and previewing an app
Open the folder so that the root directory is the content example you want to run.
Make sure the appropriate virtual environment has been created (following the steps above) and selected as the interpreter.
Click the play button to launch the application.
Creating a new project
The pip way
Create a venv
to isolate environments and generate a requirements.txt
file so that only the minimum packages needed to support your project are included. Read this for more on Python package management.
python3 -m pip freeze > requirements.txt
python3 -m pip install -r requirements.txt
The uv way
Create a manifest.json
file to support git-backed publishing
For uv projects, they can be initialized and updated with (change format and packages as needed):
uv init --app --python 3.12.6
uv add numpy matplotlib jupyter
uv sync --upgrade
uv export -o requirements.txt --no-hashes
uv run rsconnect write-manifest api .
# Dev dependencies may need to be added
uv add --dev uv ipykernel
Deploying
Reference the Posit Connect User Guide: Shiny for Python
Using Posit Publisher
Make sure the Posit Publisher extension is installed.
Click new deployment
and follow the screens to add your developer information and an API key.
Make sure to add any files that need to be included in the bundle to (1) the .toml file (2) the project files list.
For example, the .toml file might look like:
# Configuration file generated by Posit Publisher.
# Please review and modify as needed. See the documentation for more options:
# https://github.com/posit-dev/publisher/blob/main/docs/configuration.md
'$schema' = 'https://cdn.posit.co/publisher/schemas/posit-publishing-schema-v3.json'
type = 'python-shiny'
entrypoint = 'app.py'
validate = true
files = [
'/app.py',
'/data,csv',
'/requirements.txt',
'/.posit/publish/shiny-income-share-positron-FLKH.toml',
'/.posit/publish/deployments/deployment-NVOJ.toml',
'/data.csv'
]
title = 'shiny-income-share-positron'
[python]
version = "3.11.9"
package_file = "requirements.txt"
package_manager = "pip"
Reference: https://github.com/posit-dev/publisher/blob/main/docs/configuration.md
rsconnect-python CLI
# With uv
uv run rsconnect deploy shiny .
# Without uv
rsconnect deploy shiny .
Git-backed
Update the code, and then run:
# With uv
uv export -o requirements.txt --no-hashes
uv run rsconnect write-manifest shiny --overwrite .
# Without uv
pip freeze > requirements.txt
rsconnect write-manifest shiny --overwrite .
Commit the new manifest.json
file to the git repo along with the code.
Resources
Inspired by: https://www.andrewheiss.com/blog/2024/07/08/fun-with-positron/