Installation Guide¶
This guide covers different ways to install haive-games and manage dependencies.
Requirements¶
Python 3.10 or higher
pip or Poetry package manager
Git (for development installation)
Basic Installation¶
Using pip¶
The simplest way to install haive-games:
pip install haive-games
Using Poetry (Recommended)¶
For better dependency management:
poetry add haive-games
Install with Extras¶
haive-games includes optional dependencies for different features:
All Features¶
# With pip
pip install "haive-games[all]"
# With Poetry
poetry add "haive-games[all]"
Specific Features¶
# Analytics and metrics
pip install "haive-games[analytics]"
# Tournament system
pip install "haive-games[tournament]"
# AI provider support
pip install "haive-games[ai-providers]"
# Multiple features
pip install "haive-games[analytics,tournament]"
Development Installation¶
To contribute to haive-games or use the latest development version:
Clone the Repository¶
git clone https://github.com/haive-ai/haive.git
cd haive/packages/haive-games
Install with Poetry¶
# Install all dependencies including dev tools
poetry install --all-extras
# Activate the virtual environment
poetry shell
Install with pip¶
# Create virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install in editable mode
pip install -e ".[all]"
Dependency Groups¶
haive-games organizes dependencies into logical groups:
Game Categories¶
board-games: Chess, Go, Checkers, Reversi
card-games: Poker, Blackjack, UNO
social-games: Among Us, Mafia, Clue
puzzle-games: Sudoku, Wordle, Mastermind
AI & Analytics¶
ai-providers: OpenAI, Anthropic, Google AI support
analytics: Performance metrics and analysis
tournament: Tournament system and rankings
research: Research data collection tools
Integrations¶
visualization: Game state visualization
persistence: Game state persistence
multiplayer: Multi-player game support
Verifying Installation¶
After installation, verify everything is working:
# Test basic import
from haive.core import __version__
print(f"haive-games version: {__version__}")
# Test game components
from haive.games.chess import ChessAgent
from haive.games.poker import PokerAgent
from haive.core.engine.aug_llm import AugLLMConfig
# Create a simple agent
config = AugLLMConfig()
chess_ai = ChessAgent(name="TestBot", engine=config)
print("✓ Game components imported successfully")
Environment Variables¶
haive-games uses environment variables for configuration:
# LLM API Keys
export OPENAI_API_KEY="your-api-key"
export ANTHROPIC_API_KEY="your-api-key"
export GOOGLE_API_KEY="your-api-key"
# Vector Store Configuration
export PINECONE_API_KEY="your-api-key"
export PINECONE_ENVIRONMENT="your-environment"
# Optional: Default model
export HAIVE_DEFAULT_MODEL="gpt-4"
Using .env Files¶
Create a .env file in your project root:
# .env
OPENAI_API_KEY=sk-...
ANTHROPIC_API_KEY=sk-ant-...
HAIVE_DEFAULT_MODEL=gpt-4
Load it in your code:
from dotenv import load_dotenv
load_dotenv()
Troubleshooting¶
Common Installation Issues¶
ImportError: No module named ‘haive’
Ensure you’ve activated your virtual environment
Check installation: pip show haive-games
Dependency Conflicts
Use Poetry for better dependency resolution
Create a fresh virtual environment
Missing Optional Dependencies
Install the appropriate extras group
Example: pip install “haive-games[tournament]”
Platform-Specific Notes¶
Windows
Use python -m pip instead of pip if needed
Activate venv with venvScriptsactivate
macOS
May need to install Xcode Command Line Tools
Use python3 if python points to Python 2
Linux
May need to install python3-dev package
Use system package manager for system dependencies
Next Steps¶
Continue with the Getting Started guide
Explore the API Reference
Check out example projects in the repository