Installation
Get up and running in 60 seconds β‘
Quick Install
That's it! You're ready to go. π
Requirements
- Python: 3.8 or higher
- pip: Latest version recommended
# Check your Python version
python --version
# Should output: Python 3.8.x or higher
Installation Methods
Using pip (Recommended)
# Basic install
pip install memofai
# Upgrade to latest
pip install --upgrade memofai
# Install specific version
pip install memofai==1.0.0
Using pip with virtual environment
# Create virtual environment
python -m venv venv
# Activate it
source venv/bin/activate # Unix/macOS
.\venv\Scripts\activate # Windows
# Install memofai
pip install memofai
Using Poetry
Using Pipenv
Verify Installation
python -c "import memofai; print(memofai.__version__)"
Should output something like: 1.0.0
Optional Dependencies
Development Dependencies
If you're contributing or want to run tests:
Async Support
Already included! No extra dependencies needed.
from memofai import create_async_moa_client # Ready to use!
Environment Setup
1. Get Your API Token
Visit memof.ai and grab your API token.
2. Set Environment Variable
Unix/macOS:
export MEMOFAI_TOKEN="moa_your_token_here"
# Add to ~/.bashrc or ~/.zshrc for persistence
echo 'export MEMOFAI_TOKEN="moa_your_token_here"' >> ~/.zshrc
Windows (PowerShell):
$env:MEMOFAI_TOKEN = "moa_your_token_here"
# For persistence
[System.Environment]::SetEnvironmentVariable('MEMOFAI_TOKEN', 'moa_your_token_here', 'User')
Windows (CMD):
set MEMOFAI_TOKEN=moa_your_token_here
3. Use .env File (Recommended for Projects)
Create .env file:
MEMOFAI_TOKEN=moa_your_token_here
MEMOFAI_ENVIRONMENT=production
Install python-dotenv:
pip install python-dotenv
Use in code:
from dotenv import load_dotenv
import os
load_dotenv()
from memofai import create_moa_client
client = create_moa_client(
api_token=os.getenv('MEMOFAI_TOKEN'),
environment=os.getenv('MEMOFAI_ENVIRONMENT')
)
Quick Test
from memofai import create_moa_client
import os
# Initialize client
client = create_moa_client(
api_token=os.getenv('MEMOFAI_TOKEN'),
environment='production'
)
# Test connection
try:
workspaces = client.workspaces.list()
print(f"β
Connected! Found {len(workspaces)} workspaces.")
except Exception as e:
print(f"β Connection failed: {e}")
Troubleshooting
"No module named 'memofai'"
Solution: SDK not installed
"ModuleNotFoundError" in virtual environment
Solution: Wrong Python environment
# Make sure venv is activated
source venv/bin/activate # Unix
.\venv\Scripts\activate # Windows
# Then install
pip install memofai
"Permission denied" error
Solution: Install for user only
pip install --user memofai
Or use virtual environment (recommended).
Outdated pip warning
Solution: Upgrade pip
pip install --upgrade pip
IDE Setup
VS Code
Install Python extension, then SDK will have full autocomplete!
// .vscode/settings.json
{
"python.analysis.typeCheckingMode": "basic",
"python.linting.enabled": true,
"python.linting.pylintEnabled": true
}
PyCharm
Works out of the box with full type hints!
- Open Settings β Project β Python Interpreter
- Click
+ and search for memofai
- Install
- Enjoy autocomplete! β¨
Docker
Dockerfile
FROM python:3.11-slim
WORKDIR /app
# Install memofai
RUN pip install --no-cache-dir memofai
# Copy your code
COPY . .
# Set environment variable
ENV MEMOFAI_TOKEN="moa_your_token_here"
CMD ["python", "app.py"]
docker-compose.yml
version: '3.8'
services:
app:
build: .
environment:
- MEMOFAI_TOKEN=${MEMOFAI_TOKEN}
- MEMOFAI_ENVIRONMENT=production
volumes:
- .:/app
Next Steps
Installation complete! Now what?
Need Help?
Ready to build? β Quick Start Guide