Skip to content

Installation

In this tutorial you make a project folder and install redsun in it. You'll do all the tutorials that follow in that folder.

Before you start

What you need

uv, which makes the project, installs the packages and runs the scripts. Its documentation shows how to install it. You don't need to install Python yourself, because uv fetches it for you.

1. Make the project

Open a terminal in the place where you keep your work, and make a project called my-microscope:

uv init --bare --pin-python --python 3.11 my-microscope
Initialized project `my-microscope` at `/home/you/my-microscope`

The new folder holds two files: pyproject.toml lists what the project needs, and .python-version says which Python runs it.

Go into the folder, since you run every command of the tutorials from there:

cd my-microscope

2. Install redsun

Add redsun to the project, with PyQt6 to draw its windows:

uv add "redsun[pyqt]"

uv makes a virtual environment in the folder, called .venv, and installs redsun in it. You never need to activate that environment, because uv run uses it for you.

3. Check that it works

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

The command prints the version you installed:

0.14.0

What you built

You made a project folder, my-microscope, with redsun and pyqt6 installed in an environment of its own.

Next steps