Installation Guide for Windows#
This guide walks you through installing SpectroChemPy on Windows, step by step. No previous experience with the command line is needed: every command can be copied and pasted.
Choosing an Installation Method#
Three installation methods are described below, each based on a different package manager (the tool that installs Python packages). Pick one and follow only its tab, from the first step to the last. The steps of one tab do not apply to the others.
uv (recommended): the simplest choice if you are new to Python. uv also downloads Python for you.
conda / mamba: choose it if you already use Miniforge, Anaconda or conda environments, or if you also want other scientific tools from conda-forge.
pip and venv: uses a Python that you install yourself from python.org.
Two folders are involved, and it is good practice to keep them separate:
the environment, named
scpy, which contains Python, SpectroChemPy and its dependencies. You never need to open or modify it. With uv and venv, this guide puts it in%USERPROFILE%\scpy(that is,C:\Users\<yourName>\scpy); with conda / mamba, Miniforge stores it in its own folder.your working folder, which contains your data, scripts and notebooks. It can be any folder you like, for instance a
spectrochempyfolder in your Documents. Below, it is written<yourWorkingFolder>: replace it with the full path of your folder, which you can copy from the address bar of the File Explorer (for instanceC:\Users\<yourName>\Documents\spectrochempy).
Warning
Do not create the environment in a folder synchronized with the cloud (OneDrive, Google Drive, Dropbox…): it contains thousands of files, which slows down the synchronization and can break the environment. On many computers, OneDrive synchronizes the Documents and Desktop folders. Your working folder, on the other hand, can be synchronized.
Tip
To open the Command Prompt, click the Start menu, type cmd, and
select “Command Prompt”. To paste a command in it, right-click or press
Ctrl+V, then press Enter.
Step-by-step Installation#
1. Install uv. Open Windows PowerShell (Start menu, type
powershell) and run:
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
Then close PowerShell. Other ways to install uv (winget,
pipx…) are listed in
uv’s installation guide.
2. Open a new Command Prompt (Start menu, type cmd).
3. Create and activate the environment in %USERPROFILE%\scpy
(uv downloads Python if needed):
uv venv "%USERPROFILE%\scpy" --python 3.13
"%USERPROFILE%\scpy\Scripts\activate"
The prompt now starts with (scpy).
4. Install SpectroChemPy:
uv pip install spectrochempy
Optional: JupyterLab. The tutorials of this documentation are notebooks. To run them, beginners are advised to install JupyterLab in the same environment:
uv pip install jupyterlab
5. Create a desktop shortcut. It opens a Command Prompt in your
working folder with the scpy environment already active, so you do not
have to type the activation commands each time.
Open Notepad and paste the following lines. Replace
<yourWorkingFolder>with the path of your working folder, keeping the quotes:@REM open a Command Prompt in the scpy environment @CD /D "<yourWorkingFolder>" @CMD /K "%USERPROFILE%\scpy\Scripts\activate.bat"
Choose File > Save as, select “All files (*.*)” as file type, and save it as
activate-scpy.batin your working folder.In the File Explorer, right-click
activate-scpy.batand choose Send to > Desktop (create shortcut) (on Windows 11, first choose Show more options).Rename the shortcut on the desktop, for instance “SpectroChemPy prompt (scpy)”.
6. Check the installation. Double-click the shortcut: the prompt
opens in your working folder and starts with (scpy). Start IPython and
import SpectroChemPy:
ipython
In [1]: import spectrochempy as scp
Type exit to leave IPython. If you installed JupyterLab, type
jupyter lab: JupyterLab opens in your browser, in your working folder.
From now on, use the shortcut each time you work with SpectroChemPy.
Without the shortcut, open the Command Prompt and run:
cd /D "<yourWorkingFolder>"
"%USERPROFILE%\scpy\Scripts\activate"
If something goes wrong
'uv' is not recognized as an internal or external command: the Command Prompt was opened before uv was installed. Close it and open a new one. The message printed by the uv installer aboutPathcan be ignored.A virtual environment already exists: the environment was already created. To start again from scratch, add--clearto theuv venvcommand.The system cannot find the path specifiedwhen opening the shortcut: the path of the working folder or of the environment in the.batfile is wrong. Copy it again from the address bar of the File Explorer, and keep the quotes.Otherwise, see Getting Help.
1. Install Miniforge. Download the Windows installer
(Miniforge3-Windows-x86_64.exe) from
Miniforge and run it,
keeping the default options. Note the installation folder it proposes
(by default %USERPROFILE%\miniforge3): you need it for the desktop
shortcut (step 6). Skip this step if Miniforge (or Anaconda) is already
installed.
2. Open the Miniforge Prompt from the Start menu (type
miniforge). Use it instead of the plain Command Prompt, where
conda and mamba are not available.
3. Add the required channels (needed only once):
conda config --add channels conda-forge
conda config --add channels spectrocat
With Miniforge, the first command may print Warning: 'conda-forge'
already in 'channels' list, moving to the top: this is harmless.
4. Create and activate the environment:
mamba create --name scpy python=3.13
conda activate scpy
At the end, mamba create suggests mamba activate scpy; both
commands work, this guide uses conda activate. The prompt now starts
with (scpy). The environment is stored in
Miniforge’s own folder (envs\scpy), separate from your working
folder.
5. Install SpectroChemPy:
mamba install -c conda-forge -c spectrocat spectrochempy
Optional: JupyterLab. The tutorials of this documentation are notebooks. To run them, beginners are advised to install JupyterLab in the same environment:
mamba install -c conda-forge jupyterlab
6. Create a desktop shortcut. It opens a Command Prompt in your
working folder with the scpy environment already active, so you do not
have to type the activation commands each time.
Open Notepad and paste the following lines. Replace
<yourWorkingFolder>with the path of your working folder, keeping the quotes. If Miniforge is not installed in%USERPROFILE%\miniforge3, also replace that path with its installation folder:@REM open a Command Prompt in the scpy environment @CD /D "<yourWorkingFolder>" @CMD /K "%USERPROFILE%\miniforge3\Scripts\activate.bat" scpy
Choose File > Save as, select “All files (*.*)” as file type, and save it as
activate-scpy.batin your working folder.In the File Explorer, right-click
activate-scpy.batand choose Send to > Desktop (create shortcut) (on Windows 11, first choose Show more options).Rename the shortcut on the desktop, for instance “SpectroChemPy prompt (scpy)”.
7. Check the installation. Double-click the shortcut: the prompt
opens in your working folder and starts with (scpy). Start IPython and
import SpectroChemPy:
ipython
In [1]: import spectrochempy as scp
Type exit to leave IPython. If you installed JupyterLab, type
jupyter lab: JupyterLab opens in your browser, in your working folder.
From now on, use the shortcut each time you work with SpectroChemPy.
Without the shortcut, open the Miniforge Prompt and run:
cd /D "<yourWorkingFolder>"
conda activate scpy
If something goes wrong
'conda' (or 'mamba') is not recognized as an internal or external command: you are in the plain Command Prompt. Open the Miniforge Prompt instead.The system cannot find the path specifiedwhen opening the shortcut: the path of the working folder or of the environment in the.batfile is wrong. Copy it again from the address bar of the File Explorer, and keep the quotes. If Miniforge is not in%USERPROFILE%\miniforge3, use its actual installation folder.Otherwise, see Getting Help.
1. Install Python (3.11 or newer) from python.org. In the first screen of the installer, check “Add python.exe to PATH”.
2. Open the Command Prompt and check that Python is found:
python --version
It should print Python 3.11 or newer. If the Microsoft Store opens
instead, Python is not on the PATH: run the installer again and check
“Add python.exe to PATH”.
3. Create and activate the environment in %USERPROFILE%\scpy:
python -m venv "%USERPROFILE%\scpy"
"%USERPROFILE%\scpy\Scripts\activate"
python -m pip install --upgrade pip
The prompt now starts with (scpy).
4. Install SpectroChemPy:
python -m pip install spectrochempy
Optional: JupyterLab. The tutorials of this documentation are notebooks. To run them, beginners are advised to install JupyterLab in the same environment:
python -m pip install jupyterlab
5. Create a desktop shortcut. It opens a Command Prompt in your
working folder with the scpy environment already active, so you do not
have to type the activation commands each time.
Open Notepad and paste the following lines. Replace
<yourWorkingFolder>with the path of your working folder, keeping the quotes:@REM open a Command Prompt in the scpy environment @CD /D "<yourWorkingFolder>" @CMD /K "%USERPROFILE%\scpy\Scripts\activate.bat"
Choose File > Save as, select “All files (*.*)” as file type, and save it as
activate-scpy.batin your working folder.In the File Explorer, right-click
activate-scpy.batand choose Send to > Desktop (create shortcut) (on Windows 11, first choose Show more options).Rename the shortcut on the desktop, for instance “SpectroChemPy prompt (scpy)”.
6. Check the installation. Double-click the shortcut: the prompt
opens in your working folder and starts with (scpy). Start IPython and
import SpectroChemPy:
ipython
In [1]: import spectrochempy as scp
Type exit to leave IPython. If you installed JupyterLab, type
jupyter lab: JupyterLab opens in your browser, in your working folder.
From now on, use the shortcut each time you work with SpectroChemPy.
Without the shortcut, open the Command Prompt and run:
cd /D "<yourWorkingFolder>"
"%USERPROFILE%\scpy\Scripts\activate"
If something goes wrong
The Microsoft Store opens when you type
python: Python is not on the PATH. Run the python.org installer again and check “Add python.exe to PATH”, then open a new Command Prompt.python --versionprints a version older than 3.11: install a recent Python from python.org, or use the uv method instead.The system cannot find the path specifiedwhen opening the shortcut: the path of the working folder or of the environment in the.batfile is wrong. Copy it again from the address bar of the File Explorer, and keep the quotes.Otherwise, see Getting Help.
Next Steps#
Proceed to the Guides to start using SpectroChemPy.
Note
If you encounter any issues, see Getting Help for support options.