Skip to content

Installation

SpectraFit is available as a Python package and can be installed using various package managers. The recommended Python version is 3.8 or higher.

SpectraFit v1.x lifecycle notice

SpectraFit v2.0 is currently in development. SpectraFit v1.x is in end-of-life maintenance mode and will receive only critical hotfixes.

Quick Install Using UV

UV is a fast Python package installer and resolver that we recommend for installing SpectraFit:

Bash
uv pip install SpectraFit

Standard Installation Using pip

You can install SpectraFit using pip, which is the standard package manager for Python:

Bash
pip install SpectraFit

Development Installation

If you want to contribute to SpectraFit or install the latest development version, you can install directly from the GitHub repository:

Bash
# Install using UV (recommended)
uv pip install git+https://github.com/Anselmoo/SpectraFit.git

# Or using pip
pip install git+https://github.com/Anselmoo/SpectraFit.git

For a development setup with all dependencies:

Bash
# Clone the repository
git clone https://github.com/Anselmoo/SpectraFit.git
cd SpectraFit

# Install with development dependencies using UV
uv pip install -e ".[dev]"

# Setup pre-commit hooks for development
pre-commit install --install-hooks

Installation with Extra Features

SpectraFit supports optional dependencies for additional features:

Bash
# Install with all extras
uv pip install "SpectraFit[all]"

# Install with specific extras
uv pip install "SpectraFit[plotting,jupyter]"

Available extras include:

  • plotting: For enhanced visualization capabilities
  • jupyter: For Jupyter notebook integration
  • dev: For development dependencies (testing, linting, etc.)
  • all: Installs all optional dependencies

Conda Installation

If you prefer using conda for managing Python environments, you can create a dedicated environment for SpectraFit:

Bash
# Create a new conda environment
conda create -n SpectraFit python=3.10
conda activate SpectraFit

# Install using pip within conda
pip install SpectraFit

Verification

After installation, you can verify that SpectraFit is correctly installed by running:

Bash
SpectraFit --version

System Requirements

  • Python: 3.8 or higher
  • OS: Windows, macOS, or Linux
  • Dependencies: All dependencies will be automatically installed with the package

For more details on dependencies, see the pyproject.toml file in the repository.

Troubleshooting

If you encounter any issues during installation:

  1. Make sure your Python version is 3.8 or higher
  2. Try upgrading your package manager: uv pip install --upgrade pip or pip install --upgrade pip
  3. For conda environments, ensure conda-forge is in your channels: conda config --add channels conda-forge
  4. Check the GitHub Issues for known problems
  5. Report new issues on the GitHub repository