uv
is a package manager for Python.
spaCy
is a natural language processing library. spaCy
distributes different bundles of its NLP tools as separate Python packages.
Normally, one would do:
python -m spacy download en_core_web_sm # fails if using uv
But this fails when using uv
. From what I can tell, the above command calls pip
in a subprocess. The uv
package manager mirrors (most of) the pip
API. There is one major difference — uv
expects users to do uv pip
instead of just pip
.
Fortunately, spaCy
has releases available as .whl
. Installing these directly circumvents the issue.
uv pip install en_core_web_sm@https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-3.0.0/en_core_web_sm-3.0.0-py3-none-any.whl # no problem
Credit to:
Alternative solutions could include aliasing pip
to uv pip
. I haven’t tried this.