Installation from Sources#

This page explains how to install SpectroChemPy from its source code, to use the development version (the current master branch, documented as latest on this site) or to contribute to the project. If you only want to use SpectroChemPy, follow instead the step-by-step guide for your system in Installation Guide.

Contributors should clone their own fork of the repository instead of the main one: see the Developer’s Guide.

Prerequisites#

git is required to get the source code. Check whether it is installed:

git --version

If it is not:

  • Windows: download and run the installer from git-scm.com

  • macOS: run xcode-select --install (Apple command line tools), or brew install git with Homebrew

  • Linux: sudo apt install git (Debian / Ubuntu) or sudo dnf install git (Fedora)

Each method below also needs its package manager: uv, Miniforge (conda / mamba) or Python 3.11 or newer. The platform guides explain how to install them (Installation Guide for Windows, Installation Guide for macOS, Installation Guide for Linux).

Installation#

Pick one method and follow only its tab. Commands are given for macOS / Linux (bash) and, where they differ, for the Windows Command Prompt.

1. Get the source code:

git clone https://github.com/spectrochempy/spectrochempy.git
cd spectrochempy

2. Create and activate the environment in the .venv folder of the source tree:

uv venv --python 3.13
source .venv/bin/activate     # macOS / Linux
.venv\Scripts\activate        # Windows

3. Install SpectroChemPy in editable mode, with the development tools (tests, documentation, linters):

uv pip install -e ".[dev]"

4. Check the installation:

python -c "import spectrochempy as scp; print(scp.__version__)"

The version ends with .devN (for instance 1.1.4.dev9), which identifies the development version.

5. Update. Changes to the source code are taken into account immediately (editable install). To get the latest changes, from the spectrochempy folder with the environment active:

git pull origin master --ff-only
uv pip install -e ".[dev]"    # only needed if dependencies changed

6. Next time, go to the spectrochempy folder and activate the environment again (step 2, activate line only).

Note

For the development workflow (fork, branches, tests, pre-commit hooks, pull requests), see the Developer’s Guide.