Installation¶
polpack can be installed from PyPI or directly from source via GitHub.
PyPI¶
For using the PyPI package in your project, add it to your configuration file:
[project.dependencies]
polpack = "*" # (1)!
- Specifying a version is recommended
polpack>=0.1.0
pip¶
pip install --upgrade --user polpack # (1)!
- You may need to use
pip3instead ofpipdepending on your Python installation.
python -m venv .venv
source .venv/bin/activate
pip install --require-virtualenv --upgrade polpack # (1)!
- You may need to use
pip3instead ofpipdepending on your Python installation.
Note
The command to activate the virtual environment depends on your platform and shell. More info
uv¶
uv add polpack
uv sync
uv venv
uv pip install polpack
pipenv¶
pipenv install polpack
poetry¶
poetry add polpack
pdm¶
pdm add polpack
hatch¶
hatch add polpack
GitHub¶
Install the latest development version directly from the repository:
pip install --upgrade "git+https://github.com/eggzec/polpack.git#egg=polpack"
Building locally¶
Clone and build from source if you want to modify or test local changes:
git clone https://github.com/eggzec/polpack.git
cd polpack
pip install -e .
This invokes the meson build system to compile the Fortran sources and install
the resulting extension module in development mode.
Fortran compiler required
Source builds require a working Fortran compiler. On most Linux distributions,
install gfortran:
sudo apt install gfortran
sudo dnf install gcc-gfortran
brew install gcc
Install MinGW-w64 with gfortran or use MSYS2.
Verifying the installation¶
After installation, verify that the package loads correctly:
import polpack
import numpy as np
n = 10
b = np.zeros(n + 1, dtype=np.int32, order="F")
polpack.bell(n, b)
print("polpack is working! Bell numbers:", b)
Dependencies¶
| Package | Purpose |
|---|---|
numpy |
Array handling and f2py integration |
No other runtime dependencies are required.
For source builds, you additionally need:
| Package | Purpose |
|---|---|
gfortran |
Compiling Fortran sources |
meson and meson-python |
Build system |
numpy |
Required by f2py at build time |