Installation¶
smolpack is distributed as a compiled wheel on PyPI and can also be installed
from source via GitHub.
Prerequisites¶
- Python 3.10+
- NumPy (installed automatically as a dependency)
For source builds you additionally need:
- A C compiler (
gccorclang) mesonandmeson-pythonbuild systemnumpy(forf2pycompilation)
PyPI (recommended)¶
pip¶
pip install --upgrade smolpack
pyproject.toml dependency¶
[project]
dependencies = [
"smolpack"
]
requirements.txt¶
smolpack
Package managers¶
uv¶
# Add to a uv project
uv add smolpack
# Or install into the current environment
uv pip install smolpack
pipenv¶
pipenv install smolpack
poetry¶
poetry add smolpack
pdm¶
pdm add smolpack
hatch¶
hatch add smolpack
Installing from source (GitHub)¶
Install the latest development version directly from the repository:
pip install --upgrade "git+https://github.com/eggzec/smolpack.git#egg=smolpack"
Building locally¶
Clone and build from source if you want to modify the C code or test local changes:
git clone https://github.com/eggzec/smolpack.git
cd smolpack
uv pip install .
This invokes the meson build system to compile the C sources via
f2py and install the resulting extension module in development mode.
C compiler required
Source builds require a working C compiler. On most Linux
distributions install gcc
# Debian/Ubuntu
sudo apt install gcc
# Fedora
sudo dnf install gcc
# macOS (Homebrew — Clang is pre-installed via Xcode Command Line Tools)
xcode-select --install
On Windows, install MSVC (Microsoft Visual C++) via Visual Studio Build Tools. This is required for source builds and matches the official Python and NumPy wheels. MinGW is not supported.
Verifying the installation¶
After installation, verify that the package loads correctly:
import numpy as np
import smolpack
result = smolpack.int_smolyak(lambda d, x: np.exp(np.sum(x)), dim=3, qq=5)
print("smolpack is working! Integral:", result)
Dependencies¶
| Package | Purpose |
|---|---|
numpy |
Array handling, f2py integration |
No other runtime dependencies are required.