Skip to content

How to install redsun

This page shows how to install redsun with the Python tools you already use, and how to pick the optional parts your session needs. If you'd rather follow one path step by step, the tutorials use uv in Installation.

Prerequisites

You need Python 3.11 or later.

Create a virtual environment

A virtual environment keeps redsun and everything it installs apart from your other Python projects, so their versions can't clash. Create one with the tool you already use, and activate it before you install:

uv venv --python 3.11

# For Linux/macOS
source .venv/bin/activate

# For Windows Command Prompt
.venv\Scripts\activate.bat

# For Windows PowerShell
.venv\Scripts\Activate.ps1
# uses the Python you run this command with
python -m venv redsun-env

# For Linux/macOS
source redsun-env/bin/activate

# For Windows Command Prompt
redsun-env\Scripts\activate.bat

# For Windows PowerShell
redsun-env\Scripts\Activate.ps1
conda create -n redsun-env python=3.11
conda activate redsun-env
mamba create -n redsun-env python=3.11
mamba activate redsun-env

Choose the extras

redsun is on PyPI. On its own it installs what a session without a window needs. Everything else is an extra: an optional part with its own dependencies, which you name in square brackets in the install command, such as redsun[pyqt]. Pick your installer and the parts you want, and copy the command. Each button says which extra it adds, what it is for, and what it installs:

Installer
Window
Style
Data
Development
Command
pip install "redsun[pyqt]"

With uv, the command adds --compile-bytecode, which prepares the Python files to run while they install. pip does that by itself; uv otherwise leaves it to the first session you start, which then takes several seconds longer.

The guides for the optional parts are writing a derived product, keeping a catalog of runs, testing a plugin and profiling a session. The development extras belong in your project's development dependencies, not in what it needs to run.

For a session with a window, install one of the two Qt extras. pyqt and pyside install the PyQt6 and PySide6 bindings, and redsun works with either through qtpy. pyside installs only PySide6's essential modules, so a project that needs one of its add-on modules, such as QtCharts or QtMultimedia, adds pyside6 to its own dependencies. A headless session, with no window, needs neither.

Check the installation

With the environment still active, run:

python -c "import redsun; print(redsun.__version__)"

If redsun is installed, this prints its version.

If you installed a window extra, open the example session, which holds every built-in component over simulated devices:

redsun --example

The redsun command lists what else it takes.

To change redsun itself, see How to contribute.