Installation
Maticlib can be installed in multiple ways depending on your needs. Choose the installation method that best suits your project requirements.
System Requirements
Before installing Maticlib, ensure your system meets these requirements:
- Python: Version 3.8 or higher
- pip: Latest version recommended
- Operating System: Windows, macOS, or Linux
Dependencies
Maticlib requires the following Python packages (automatically installed):
httpx>= 0.24.0 - Modern HTTP client with async supportpydantic>= 2.0 - Data validation and settings management
Install from PyPI (Recommended)
The easiest and recommended way to install Maticlib is from PyPI using pip:
pip install maticlib
This command will install the latest stable version along with all required dependencies.
Upgrade to Latest Version
To upgrade an existing installation to the latest version:
pip install --upgrade maticlib
Install from TestPyPI
To test pre-release versions or development builds from TestPyPI:
pip install -i https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ maticlib
Install from Source
To install the latest development version directly from GitHub:
git clone https://github.com/arvohsoft/maticlib.git
cd maticlib
pip install -e .
The -e flag installs the package in editable mode, which is useful if you want to modify the source code.
Development Installation
If you want to contribute to Maticlib or need development tools, install it with dev dependencies:
# Clone the repository
git clone https://github.com/arvohsoft/maticlib.git
cd maticlib
# Create a virtual environment (recommended)
python -m venv venv
# Activate virtual environment
# On Linux/Mac:
source venv/bin/activate
# On Windows:
venv\Scripts\activate
# Install in development mode with dev dependencies
pip install -e ".[dev]"
Development dependencies include:
pytest- Testing frameworkblack- Code formattermypy- Static type checkerflake8- Linting tool
Virtual Environment Setup
It's strongly recommended to use a virtual environment to isolate your project dependencies:
Using venv (Built-in)
# Create virtual environment
python -m venv maticlib-env
# Activate on Linux/Mac
source maticlib-env/bin/activate
# Activate on Windows
maticlib-env\Scripts\activate
# Install maticlib
pip install maticlib
Using conda
# Create conda environment
conda create -n maticlib python=3.10
# Activate environment
conda activate maticlib
# Install maticlib
pip install maticlib
Verify Installation
After installation, verify that Maticlib is installed correctly:
python -c "import maticlib; print(maticlib.__version__)"
You should see the version number printed. If you see an error, the installation may have failed.
Check Installed Components
python -c "from maticlib.llm.google_genai import GoogleGenAIClient; print('✓ Google GenAI Client available')"
python -c "from maticlib.llm.mistral import MistralClient; print('✓ Mistral Client available')"
python -c "from maticlib.graph import MaticGraph; print('✓ MaticGraph available')"
API Key Setup
Set up your API keys as environment variables for secure access:
Linux/Mac
# Temporary (current session only)
export GOOGLE_API_KEY="your-google-api-key"
export MISTRAL_API_KEY="your-mistral-api-key"
# Permanent (add to ~/.bashrc or ~/.zshrc)
echo 'export GOOGLE_API_KEY="your-google-api-key"' >> ~/.bashrc
echo 'export MISTRAL_API_KEY="your-mistral-api-key"' >> ~/.bashrc
source ~/.bashrc
Windows (PowerShell)
# Temporary (current session only)
$env:GOOGLE_API_KEY="your-google-api-key"
$env:MISTRAL_API_KEY="your-mistral-api-key"
# Permanent (system-wide)
[Environment]::SetEnvironmentVariable("GOOGLE_API_KEY", "your-google-api-key", "User")
[Environment]::SetEnvironmentVariable("MISTRAL_API_KEY", "your-mistral-api-key", "User")
Windows (Command Prompt)
# Temporary (current session only)
set GOOGLE_API_KEY=your-google-api-key
set MISTRAL_API_KEY=your-mistral-api-key
# Permanent (use setx)
setx GOOGLE_API_KEY "your-google-api-key"
setx MISTRAL_API_KEY "your-mistral-api-key"
Using .env File (Recommended)
Create a .env file in your project root:
GOOGLE_API_KEY=your-google-api-key
MISTRAL_API_KEY=your-mistral-api-key
Then load it using python-dotenv:
pip install python-dotenv
# In your Python script
from dotenv import load_dotenv
load_dotenv()
from maticlib.llm.google_genai import GoogleGenAIClient
client = GoogleGenAIClient() # API key loaded from .env
.env to your .gitignore file to prevent accidentally committing sensitive API keys to version control.
Obtaining API Keys
Google Gemini API Key
- Visit Google AI Studio
- Sign in with your Google account
- Click "Get API Key" in the dashboard
- Copy the generated API key
Mistral AI API Key
- Visit Mistral AI Console
- Create an account or sign in
- Navigate to API Keys section
- Generate a new API key
- Copy the key (it won't be shown again)
Troubleshooting
Installation Fails
If installation fails, try:
# Update pip
pip install --upgrade pip
# Install with --user flag
pip install --user maticlib
# Use Python 3 explicitly
python3 -m pip install maticlib
Import Errors
If you get import errors after installation:
- Ensure you're using the correct Python environment
- Verify installation:
pip show maticlib - Reinstall:
pip uninstall maticlib && pip install maticlib
Version Conflicts
If you encounter dependency conflicts:
# Create a fresh virtual environment
python -m venv fresh-env
source fresh-env/bin/activate # or fresh-env\Scripts\activate on Windows
pip install maticlib
Uninstalling
To completely remove Maticlib:
pip uninstall maticlib
Docker Installation (Optional)
For containerized deployments, create a Dockerfile:
FROM python:3.10-slim
WORKDIR /app
# Install maticlib
RUN pip install maticlib
# Copy your application
COPY . .
CMD ["python", "your_app.py"]
Build and run:
docker build -t my-maticlib-app .
docker run -e GOOGLE_API_KEY=your-key my-maticlib-app
Next Steps
Now that you have Maticlib installed:
- Follow the Getting Started Guide to make your first API call
- Explore Google GenAI Client documentation
- Learn about building workflows with MaticGraph
- Check out example projects on GitHub
Need Help?
If you encounter issues during installation:
- Check existing GitHub issues
- Create a new issue with installation details
- Email us at arvohsoft@gmail.com