Installation¶
Requirements¶
- Python 3.9 or higher
- pip package manager
Basic Installation¶
Install querygym from PyPI:
This installs the core package with minimal dependencies:
- typer - CLI interface
- pyyaml - Prompt bank parsing
- openai - LLM client
- tqdm - Progress bars
Optional Dependencies¶
HuggingFace Datasets¶
For loading datasets from HuggingFace:
BEIR Format Support¶
For working with BEIR benchmark datasets:
Pyserini Integration¶
For using Pyserini search adapters:
All Optional Features¶
Install everything:
Development Installation¶
For contributing to querygym:
# Clone the repository
git clone https://github.com/ls3-lab/QueryGym.git
cd QueryGym
# Install in editable mode with dev dependencies
pip install -e .[dev]
This includes: - Testing tools (pytest, pytest-cov, pytest-mock) - Code quality tools (black, ruff, mypy) - Documentation tools (mkdocs, mkdocs-material, mkdocstrings)
Verify Installation¶
Check that querygym is installed correctly:
# Check version
pip show querygym
# Test import
python -c "import querygym; print(querygym.__version__)"
# Test CLI
querygym --help
Environment Setup¶
API Keys¶
querygym uses OpenAI-compatible APIs. Set your API key:
For custom endpoints:
Configuration File¶
Create a .env file in your project:
Troubleshooting¶
Import Errors¶
If you get import errors for optional dependencies:
Version Conflicts¶
If you have dependency conflicts:
# Create a fresh virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install querygym
Development Installation Issues¶
If editable install fails:
# Upgrade pip and setuptools
pip install --upgrade pip setuptools wheel
# Try again
pip install -e .[dev]