Skip to content

Latest commit

 

History

History
265 lines (184 loc) · 6 KB

File metadata and controls

265 lines (184 loc) · 6 KB

Installation Guide

Complete installation guide for MeridianAlgo.

System requirements

Python version

  • Python 3.10 or newer, tested on 3.10, 3.11, and 3.12
  • Python 3.11 or newer recommended for best performance

Operating systems

  • Windows 10 and 11
  • macOS 10.14 or newer
  • Linux, for example Ubuntu 18.04 or newer and CentOS 7 or newer

Hardware

  • CPU with 2 or more cores recommended
  • RAM of 4 GB or more, 8 GB or more for large datasets
  • Storage of 1 GB or more free space
  • GPU is optional but helps for ML features, NVIDIA CUDA, AMD ROCm, or Apple MPS

Quick installation

Basic installation

# Install MeridianAlgo
pip install meridianalgo

# Verify installation
python -c "import meridianalgo; print(meridianalgo.__version__)"

The core library runs on numpy, pandas, and scipy alone.

Installation with optional dependencies

# Install with all optional dependencies
pip install "meridianalgo[all]"

# Install with specific groups
pip install "meridianalgo[ml]"            # scikit-learn, torch, statsmodels, hmmlearn
pip install "meridianalgo[optimization]"  # cvxpy, cvxopt
pip install "meridianalgo[volatility]"    # arch (GARCH)
pip install "meridianalgo[data]"          # lxml, beautifulsoup4, polygon-api-client
pip install "meridianalgo[distributed]"   # ray, dask
pip install "meridianalgo[dev]"           # test and lint tooling

The core install imports cleanly without any of these extras. The extras unlock the machine learning models, convex solvers, and maximum likelihood GARCH. Modules that need an optional dependency stay unavailable until the matching group is installed, and the rest of the library keeps working.

Detailed installation

1. Create a virtual environment, recommended

# Create virtual environment
python -m venv meridianalgo_env

# Activate virtual environment
# Windows
meridianalgo_env\Scripts\activate
# macOS and Linux
source meridianalgo_env/bin/activate

2. Install MeridianAlgo

# Install from PyPI
pip install meridianalgo

# Or install from source
git clone https://github.com/MeridianAlgo/Python-Packages.git
cd Python-Packages
pip install -e .

Development installation

For developers who want to contribute or modify the source code.

# Clone repository
git clone https://github.com/MeridianAlgo/Python-Packages.git
cd Python-Packages

# Install in development mode
pip install -e .

# Install development dependencies
pip install "meridianalgo[dev]"

# Run tests
pytest tests/

Conda installation

If you prefer using Conda.

# Create conda environment
conda create -n meridianalgo python=3.12

# Activate environment
conda activate meridianalgo

# Install the core scientific stack with conda
conda install numpy pandas scipy

# Install MeridianAlgo with pip
pip install meridianalgo

Docker installation

For containerized deployment.

# Dockerfile
FROM python:3.12-slim

# Install system dependencies
RUN apt-get update && apt-get install -y \
    gcc \
    g++ \
    && rm -rf /var/lib/apt/lists/*

# Install Python dependencies
RUN pip install --no-cache-dir meridianalgo

# Set working directory
WORKDIR /app

# Copy application code
COPY . .

# Run application
CMD ["python", "your_script.py"]

Verification

After installation, verify everything is working with APIs that run in the base install.

# Check the version
import pandas as pd
import meridianalgo as ma
print(f"MeridianAlgo version {ma.__version__}")

# Technical indicators, base install, no extras
prices = pd.Series([100, 101, 102, 101, 103, 104, 103, 105])
rsi = ma.RSI(prices, period=4)
print(f"RSI calculated, {len(rsi.dropna())} values")

# Top level performance metrics
returns = prices.pct_change().dropna()
print(f"Sharpe ratio {ma.calculate_sharpe_ratio(returns):.4f}")

print("All checks passed. MeridianAlgo is working correctly.")

Troubleshooting

Common issues

1. Import errors

# If you get import errors, try reinstalling
pip uninstall meridianalgo
pip install meridianalgo

# Or install with --force-reinstall
pip install --force-reinstall meridianalgo

2. PyTorch installation issues

# For CPU only PyTorch
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu

# For CUDA if you have an NVIDIA GPU
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118

3. Memory issues

# For large datasets, process the data in chunks
import pandas as pd

chunk_size = 1000
for chunk in pd.read_csv("large_data.csv", chunksize=chunk_size):
    # Process chunk
    pass

Platform specific issues

Windows

If you get Microsoft Visual C++ errors, install the Microsoft C++ Build Tools, or use conda instead of pip.

macOS

# If you get compilation errors, install the Xcode command line tools
xcode-select --install

Linux

# Install build essentials
sudo apt-get update
sudo apt-get install build-essential

# For Ubuntu and Debian
sudo apt-get install python3-dev

# For CentOS and RHEL
sudo yum install python3-devel

Updating

# Update to latest version
pip install --upgrade meridianalgo

# Check current version
python -c "import meridianalgo; print(meridianalgo.__version__)"

Uninstallation

# Uninstall MeridianAlgo
pip uninstall meridianalgo

Support

If you encounter issues, here is the order that usually helps.

  1. Search GitHub Issues for similar problems
  2. Create a new issue with detailed error information
  3. Join GitHub Discussions for community help

Next steps

After a successful installation, here is where to go.

  1. Read the Quick start guide to get started
  2. Explore the API reference for detailed documentation
  3. Try the per module snippets in the module guide
  4. Check the Performance benchmarks for optimization tips