Installation¶
This guide will help you install and configure AlgoGraph on your system.
Requirements¶
- Python 3.8 or higher
- (Optional) AlgoTree library for tree-graph interoperability
Installation Steps¶
Step 1: Clone the Repository¶
Currently, AlgoGraph is available from the source repository:
Step 2: Set Up PYTHONPATH¶
AlgoGraph requires you to configure your PYTHONPATH to include the parent directory of the repository.
On Linux/macOS¶
Add the following to your ~/.bashrc or ~/.zshrc:
For example, if you cloned the repository to /home/user/github/released/AlgoGraph:
Then reload your shell configuration:
On Windows¶
Using Command Prompt:
Using PowerShell:
Permanent Configuration:
- Right-click on "This PC" or "My Computer"
- Select "Properties" → "Advanced system settings"
- Click "Environment Variables"
- Under "User variables", click "New"
- Variable name:
PYTHONPATH - Variable value:
C:\path\to\released
Step 3: Verify Installation¶
Test that AlgoGraph is correctly installed:
You should see:
Optional: Install AlgoTree¶
For tree-graph interoperability features, install AlgoTree:
# Clone AlgoTree (if in same parent directory)
cd /path/to/released
git clone https://github.com/released/AlgoTree.git
Update your PYTHONPATH as described above to include both libraries.
Verify AlgoTree integration:
AlgoTree is Optional
AlgoTree integration is completely optional. All core AlgoGraph features work without it. You only need AlgoTree if you want to convert between tree and graph representations.
Interactive Shell¶
To use the interactive graph shell:
Or load a specific graph file:
Development Installation¶
If you plan to contribute to AlgoGraph or run tests:
# Install development dependencies
pip install pytest pytest-benchmark
# Run tests
cd /path/to/released/AlgoGraph
pytest
# Run with coverage
pytest --cov=AlgoGraph
# Run benchmarks
pytest test/ --benchmark-only
Troubleshooting¶
Import Error: No module named 'AlgoGraph'¶
Problem: Python cannot find the AlgoGraph module.
Solution: Verify your PYTHONPATH is set correctly:
Make sure it includes the parent directory of AlgoGraph (the released directory, not AlgoGraph itself).
Import Error: No module named 'AlgoTree'¶
Problem: AlgoTree features are being used but AlgoTree is not installed.
Solution: Either install AlgoTree (see above) or avoid using interop functions like tree_to_graph and graph_to_tree.
Shell Commands Don't Have Tab Completion¶
Problem: Tab completion doesn't work in the interactive shell.
Solution: Install readline support:
Next Steps¶
Now that you have AlgoGraph installed, proceed to:
- Quick Start Guide - Learn the basics
- Basic Examples - See common use cases
- Core Concepts - Understand the fundamentals