"""
install_spacy_model.py (v2 - explicit version)
Run from cPanel's "Execute Python Script" box by entering:
    install_spacy_model.py

This bypasses `spacy download`'s auto version-detection, which was
generating a malformed URL with a missing version number.
"""
import subprocess
import sys

MODEL_URL = (
    "https://github.com/explosion/spacy-models/releases/download/"
    "en_core_web_sm-3.7.1/en_core_web_sm-3.7.1-py3-none-any.whl"
)

result = subprocess.run(
    [sys.executable, "-m", "pip", "install", MODEL_URL],
    capture_output=True,
    text=True,
)

print("STDOUT:")
print(result.stdout)
print("STDERR:")
print(result.stderr)
print("Exit code:", result.returncode)