Set up Positron and uv
What each tool does¶
| Tool | Explanation |
|---|---|
| Python | A programming language that we will use in later sessions to work with data |
| Positron | The application where you open projects, notebooks, data, and results |
uv |
A tool that installs Python versions and packages and keeps a project's environment organised |
Step 1: install Positron¶
- Open the official Positron download page.
- Download the installer for your operating system.
- Install and open Positron.
Step 2: check or install uv¶
To verify it's actually installed:
- In Positron, open View > Terminal.
- Type the command below and press Enter.
If a version number appears, uv is ready.
The official uv installation page lists alternative installation methods.
If installation is restricted
You do not need administrator rights for every installation method. If your network blocks the installer, continue with a neighbour and tell the instructor.
Step 3: create a project environment¶
The Positron menus may look slightly different across versions, but the workflow is the same.
- In Positron, choose New > New Folder from Template.
- Select Python Project.
- Choose a location such as your Documents folder and name the project
indigo-data. - When asked, create a
pyproject.tomlfile. - Choose Create a new virtual environment.
- Choose
uvas the environment provider (default). - Name the environment
.venv(default). - Choose the latest stable Python version offered by Positron, then select Create.
Positron may download Python through uv if Python is not already installed. This is expected. A new .venv folder should appear in the project, along with a pyproject.toml file.
Step 4: install one package and verify it can be used¶
We will install polars, a common package for working with tables.
- Make sure the Positron terminal is open in the
indigo-dataproject. - Go to Terminal:
The command adds the package to the project and updates the project's environment. It should also record the dependency in pyproject.toml.
- Go to Console.
- Copy the following code block, paste it, and press Enter:
You have succeeded when the cell prints a Python path, a Python version, and a polars version without errors.
Troubleshooting
uv is not found: close and reopen the terminal, then try uv --version again. If it still fails, use the official uv installation page or ask for help.
The .venv environment does not appear: open the Command Palette and run Interpreter: Discover All Interpreters, then select the .venv environment.
The notebook uses the wrong environment: click the kernel selector at the top of the notebook and choose the interpreter inside your project's .venv folder.
The package installation fails: check your internet connection and the spelling of uv add polars. If the computer is managed by your school or company, ask the instructor rather than changing security settings yourself.
For more detail, see Positron's Python installation and environment guide and first Python notebook tutorial.