SDK

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 higher

Install

Install OptixLog using pip:

pip install optixlog

Verify 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!")

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 optixlog

Windows

# Create virtual environment
python -m venv optixlog-env

# Activate it
optixlog-env\Scripts\activate

# Install OptixLog
pip install optixlog

When you're done:

deactivate  # Deactivate the virtual environment

Dependencies

The following packages are automatically installed with OptixLog:

PackageVersionPurpose
requestsLatestHTTP communication with API
numpyLatestNumerical operations and arrays
matplotlibLatestPlot generation and visualization
pillowLatestImage processing
rich≥13.0.0Colored 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-bin

macOS (with Homebrew):

brew install open-mpi

Verify MPI installation:

mpirun --version

Step 2: Install mpi4py

pip install optixlog[mpi]

Or install mpi4py separately:

pip install mpi4py

Meep (Photonic Simulations)

For photonic simulations with Meep, install separately via system package manager:

Ubuntu/Debian:

sudo apt-get install meep python3-meep

macOS (with Homebrew):

brew install meep

Or install all optional dependencies:

pip install optixlog[full]

This installs:

  • mpi4py for 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 optixlog

pip Not Found

If pip command is not found:

# Try using python -m pip
python -m pip install optixlog

# Or python3
python3 -m pip install optixlog

Import 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:

  1. Verify MPI is installed:

    mpirun --version
    which mpirun
  2. Verify mpi4py is installed:

    python -c "import mpi4py; print(mpi4py.__version__)"
  3. Check environment variables:

    echo $OMPI_COMM_WORLD_RANK
    echo $PMI_RANK
  4. 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.py

NumPy 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 optixlog

Check your current version:

import optixlog
print(optixlog.__version__)

Uninstall

Remove OptixLog from your system:

pip uninstall optixlog

Development 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
  • OS: Linux (Ubuntu 20.04+) or macOS 11+
  • Python: 3.9+
  • RAM: 512 MB+
  • Disk: 100 MB+

Next Steps

On this page