Skip to main content
Choose the installation method that fits your needs, from a minimal pip install for basic spell checking to a full development setup with Cython acceleration, transformer models, and ONNX inference.

Basic Installation

This installs the core library with all essential features:
  • Syllable validation
  • Word validation with SymSpell
  • Context checking with N-grams
  • SQLite dictionary provider
  • CLI tools

Verify Installation

Dictionary Database

mySpellChecker requires a dictionary database for spell checking. No bundled database is included, so you must build one first.

Providing a Database

Pass the database path explicitly:
  • Use SQLiteProvider(database_path="/path/to/db.db")
  • Or use CLI flag: myspellchecker check --db /path/to/db.db
  • Or set in config file: database: /path/to/db.db
  • Or set environment variable: MYSPELL_DATABASE_PATH (via ConfigLoader)

Building a Sample Database

Building from Corpus

See Data Pipeline for detailed dictionary building instructions.

Installation Options

With AI/Semantic Features

For deep learning-based context checking:
This adds:
  • ONNX Runtime for semantic model inference
  • Tokenizers library for fast text tokenization
  • Pre-trained semantic models support

With Transformer POS Tagger

For highest accuracy POS tagging (~93%):
This adds:
  • PyTorch
  • Hugging Face Transformers
  • Pre-trained Myanmar POS models support

Full Installation

Install complete AI features (Semantic + Transformer POS):
Combines: ai + transformers

With Dictionary Building Tools

For building custom dictionaries from corpora:
This adds:
  • PyArrow for columnar data processing
  • DuckDB for fast pipeline aggregations
  • xxhash for deduplication hashing
  • tqdm for progress bars
  • cached-path for resource downloading

With Model Training

For training custom semantic and POS models:
This adds:
  • PyTorch
  • Hugging Face Transformers
  • Datasets for data loading
  • Accelerate for distributed training
  • ONNX and ONNX Runtime for model export
  • onnxscript for torch ONNX export
  • Tokenizers for BPE tokenizer training

Development Installation

For contributors and developers:
This adds:
  • pytest and testing tools
  • ruff for linting/formatting
  • mypy for type checking
  • Note: Cython is automatically installed as a build dependency, not part of the [dev] extra.

Platform-Specific Instructions

Linux (Ubuntu/Debian)

Linux (RHEL/CentOS/Fedora)

macOS

Note: Without libomp, Cython extensions will compile without parallel processing. The library will still work but batch processing will be single-threaded.

Windows

Virtual Environment Setup

We recommend using a virtual environment:

Using venv

Using conda

Using Poetry

Building from Source

For development or to get the latest features:

Clone and Install

Development Dependencies

The development installation includes:
Note: Cython is automatically installed as a build-system dependency (specified in pyproject.toml build requirements), not as part of the [dev] extra.

Running Tests

Cython Extension Compilation

Cython extensions provide significant performance improvements. They’re automatically compiled during installation, but if you modify .pyx files:

Troubleshooting Cython Build

Missing C++ Compiler:
OpenMP Not Found (macOS):
If OpenMP installation fails, the library will compile with single-threaded extensions (graceful degradation).

Verifying Installation

Run this script to verify all components are installed correctly:

Common Issues

Issue: “No module named ‘myspellchecker’”

Solution: Ensure you’re in the correct virtual environment:

Issue: “Database not found”

Solution: Build or download a dictionary database:

Issue: “Cython extension failed to compile”

Solution: Install a C++ compiler:
Cython extensions provide performance improvements but are not strictly required. The library falls back to pure Python implementations if Cython is unavailable.

Issue: “OpenMP not found” (macOS)

Solution: Install libomp:
This is optional - the library works without OpenMP but uses single-threaded processing.

Docker Installation

For containerized deployments, mySpellChecker provides Docker support with multi-stage builds.

Quick Start with Docker Compose

Available Docker Services

Building Docker Images

For detailed Docker configuration, see the Docker Guide.

Next Steps