Installation
Install the OptixLog SDK and get started in minutes
Installation
Install the OptixLog SDK and get started in minutes.
Requirements
- Python 3.8+ (Python 3.9+ recommended)
- pip package manager
Verify your Python version:
python --version # Should be 3.8 or higherInstall
Install OptixLog using pip:
pip install optixlogVerify Installation
Test that the SDK is installed correctly:
import optixlog
print(optixlog.__version__) # Should print "0.2.0"Quick test:
from optixlog import Optixlog
# This should import without errors
client = Optixlog(api_key="test_key")
print("OptixLog SDK installed successfully!")Virtual Environment (Recommended)
Using a virtual environment helps avoid package conflicts:
Linux/macOS
# Create virtual environment
python -m venv optixlog-env
# Activate it
source optixlog-env/bin/activate
# Install OptixLog
pip install optixlogWindows
# Create virtual environment
python -m venv optixlog-env
# Activate it
optixlog-env\Scripts\activate
# Install OptixLog
pip install optixlogWhen you're done:
deactivate # Deactivate the virtual environmentDependencies
The following packages are automatically installed with OptixLog:
| Package | Version | Purpose |
|---|---|---|
requests | Latest | HTTP communication with API |
numpy | Latest | Numerical operations and arrays |
matplotlib | Latest | Plot generation and visualization |
pillow | Latest | Image processing |
rich | ≥13.0.0 | Colored console output |
Optional Dependencies
MPI Support
For parallel simulations with MPI, install the MPI extras:
Step 1: Install system MPI
Ubuntu/Debian:
sudo apt-get install libopenmpi-dev openmpi-binmacOS (with Homebrew):
brew install open-mpiVerify MPI installation:
mpirun --versionStep 2: Install mpi4py
pip install optixlog[mpi]Or install mpi4py separately:
pip install mpi4pyMeep (Photonic Simulations)
For photonic simulations with Meep, install separately via system package manager:
Ubuntu/Debian:
sudo apt-get install meep python3-meepmacOS (with Homebrew):
brew install meepOr install all optional dependencies:
pip install optixlog[full]This installs:
mpi4pyfor MPI support
Note: Meep must still be installed via system package manager.
Troubleshooting
Permission Denied
If you get permission errors:
# Use --user flag
pip install --user optixlog
# Or use virtual environment (recommended)
python -m venv env
source env/bin/activate
pip install optixlogpip Not Found
If pip command is not found:
# Try using python -m pip
python -m pip install optixlog
# Or python3
python3 -m pip install optixlogImport Errors
If you get import errors after installation:
# Reinstall with cache clear
pip install --upgrade --force-reinstall --no-cache-dir optixlog
# Verify installation
python -c "import optixlog; print(optixlog.__version__)"MPI Not Detected
If MPI is not detected even after installing mpi4py:
-
Verify MPI is installed:
mpirun --version which mpirun -
Verify mpi4py is installed:
python -c "import mpi4py; print(mpi4py.__version__)" -
Check environment variables:
echo $OMPI_COMM_WORLD_RANK echo $PMI_RANK -
Test MPI:
mpirun -n 2 python -c "from mpi4py import MPI; print(f'Rank {MPI.COMM_WORLD.Get_rank()}')"
Matplotlib Backend Issues
If you get matplotlib backend errors in headless environments:
import matplotlib
matplotlib.use('Agg') # Use non-interactive backend
from optixlog import Optixlog
# Rest of your code...Or set environment variable:
export MPLBACKEND=Agg
python your_script.pyNumPy Version Conflicts
If you encounter NumPy version conflicts:
# Upgrade numpy
pip install --upgrade numpy
# Or install specific version
pip install "numpy>=1.20.0,<2.0.0"Upgrade
Upgrade to the latest version:
pip install --upgrade optixlogCheck your current version:
import optixlog
print(optixlog.__version__)Uninstall
Remove OptixLog from your system:
pip uninstall optixlogDevelopment Installation
To install OptixLog in editable mode for development:
# Clone the repository
git clone https://github.com/yourusername/optixlog-sdk.git
cd optixlog-sdk/sdk
# Install in editable mode
pip install -e .
# With optional dependencies
pip install -e ".[mpi,full]"This allows you to edit the source code and see changes immediately without reinstalling.
System Requirements
Minimum
- OS: Linux, macOS, Windows
- Python: 3.8+
- RAM: 256 MB
- Disk: 50 MB
Recommended
- OS: Linux (Ubuntu 20.04+) or macOS 11+
- Python: 3.9+
- RAM: 512 MB+
- Disk: 100 MB+
Next Steps
- Quick Start Guide - Get logging in 5 minutes
- API Reference - Explore the full API
- Examples - See real-world usage patterns