Beginner

Installing spaCy

Get spaCy installed, download language models, and verify your setup in minutes.

Install with pip

Terminal — pip install
# Install spaCy
pip install spacy

# Download an English model
python -m spacy download en_core_web_sm    # Small (12 MB)
python -m spacy download en_core_web_md    # Medium (40 MB)
python -m spacy download en_core_web_lg    # Large (560 MB)
python -m spacy download en_core_web_trf   # Transformer-based

Model Sizes Compared

ModelSizeVectorsAccuracySpeedBest For
en_core_web_sm12 MBNo word vectorsGoodFastestPrototyping, basic NER
en_core_web_md40 MB20k vectorsBetterFastSimilarity, general use
en_core_web_lg560 MB685k vectorsBest (CNN)ModerateProduction, similarity
en_core_web_trf438 MBContext vectorsBest overallSlow (GPU)Max accuracy

Install with GPU Support

Terminal — GPU setup
# Install with CUDA support (for transformer models)
pip install spacy[cuda12x]

# Or for specific CUDA version
pip install spacy[cuda11x]

# Verify GPU is available
python -c "import spacy; spacy.prefer_gpu(); print('GPU enabled')"

Verify Installation

Python — Quick verification
import spacy

# Check version
print(f"spaCy version: {spacy.__version__}")

# Load model and test
nlp = spacy.load("en_core_web_sm")
doc = nlp("spaCy is an amazing NLP library!")

# Print tokens with their attributes
for token in doc:
    print(f"{token.text:12} {token.pos_:6} {token.dep_:10} {token.lemma_}")

# Validate full installation
spacy.cli.validate()
Recommendation: Start with en_core_web_sm for development and switch to en_core_web_lg or en_core_web_trf for production. The small model is fast to download and good enough for learning.