Installation¶
This guide covers different installation options for ShortKit-ML.
Requirements¶
- Python 3.9, 3.10, or 3.11
- pip or uv package manager
- PyTorch (torch) and torchvision (included in core install; see PyTorch with CUDA for GPU)
Quick Install¶
From PyPI (Recommended)¶
From Source¶
Installation Options¶
The library has several optional dependency groups for different use cases:
Basic Installation¶
Core functionality with all detection methods:
With Dashboard¶
For the interactive Gradio web interface:
With Jupyter Support¶
For running examples in Jupyter notebooks:
With Reporting¶
For PDF/HTML report generation:
With Hugging Face¶
For embedding generation from HuggingFace models:
With VAE¶
VAE shortcut detection requires torch and torchvision; both are core dependencies and included in the default install. To explicitly install VAE support:
Full Installation¶
Install everything (recommended for development):
Using uv (Faster)¶
uv is a fast Python package installer:
# Install uv
curl -LsSf https://astral.sh/uv/install.sh | sh
# Create virtual environment
uv venv --python 3.10
source .venv/bin/activate # Windows: .venv\Scripts\activate
# Install with all dependencies
uv pip install -e ".[all]"
PyTorch with CUDA¶
For GPU acceleration (optional):
# CUDA 12.1
pip install torch==2.1.0+cu121 torchvision==0.16.0+cu121 \
--index-url https://download.pytorch.org/whl/cu121
# CUDA 11.8
pip install torch==2.1.0+cu118 torchvision==0.16.0+cu118 \
--index-url https://download.pytorch.org/whl/cu118
Jupyter Kernel Setup¶
To use the library in Jupyter notebooks:
# Install Jupyter support
pip install "shortcut-detect[jupyter]"
# Register the kernel
python -m ipykernel install --user --name=shortcut_detect --display-name="Python (Shortcut_Detect)"
# Launch Jupyter
jupyter lab
Verify Installation¶
import shortcut_detect
print(shortcut_detect.__version__) # Should print: 0.1.0
# Test imports
from shortcut_detect import ShortcutDetector, HBACDetector, SKLearnProbe
print("All imports successful!")
Troubleshooting¶
Import Errors¶
If you get import errors, ensure all dependencies are installed:
CUDA Issues¶
If PyTorch doesn't detect your GPU:
import torch
print(torch.cuda.is_available()) # Should be True
print(torch.cuda.device_count()) # Number of GPUs
WeasyPrint Issues (PDF Generation)¶
WeasyPrint requires system dependencies:
Install GTK3 runtime from gtk.org
Next Steps¶
- Quick Start Guide - Run your first shortcut detection
- Interactive Dashboard - Launch the web interface
- Detection Methods - Learn about each method