Installation
Requirements
Python >= 3.10
NumPy
CMake >= 3.15
C compiler (gcc, clang, or MSVC)
Using pip
pip install .
Using UV
UV is a fast Python package installer and resolver:
uv pip install .
Development Installation
For development, install in editable mode with development dependencies:
pip install -e ".[dev]"
Or with UV:
uv pip install -e ".[dev]"
Building from Source
Clone the repository:
git clone <repository-url> cd kmeans
Build and install:
pip install .
The build process will:
Configure CMake
Compile the C extension
Build the Python wheel
Install the package
Troubleshooting
CMake not found
Install CMake:
# Ubuntu/Debian
sudo apt-get install cmake
# macOS
brew install cmake
# Windows
# Download from https://cmake.org/download/
Compiler not found
Install a C compiler:
# Ubuntu/Debian
sudo apt-get install build-essential
# macOS (installs clang)
xcode-select --install
# Windows
# Install Visual Studio with C++ support