Repository navigation
Closed
Description
How to reproduce the behaviour
python -m pip install spacy
python -c "import spacy" # results in failure
Your Environment
- Operating System: MacOS / Ubuntu (CI)
- Python Version Used: 3.11
- spaCy Version Used: 3.8.14
- Environment Information: Brand new
venvbased environment
The output in fresh install of env
((.venv) ) martratas@Marts-MacBook-Pro 2026_05_27_spacy_click % pip freeze
((.venv) ) martratas@Marts-MacBook-Pro 2026_05_27_spacy_click % pip --version
pip 26.1.1 from /Users/martratas/Documents/CogStack/.MedCAT.nosync/monorepo-nlp/medcat-v2/.temp/2026_05_27_spacy_click/.venv/lib/python3.12/site-packages/pip (python 3.12)
((.venv) ) martratas@Marts-MacBook-Pro 2026_05_27_spacy_click % python -m pip install spacy
Collecting spacy
Using cached spacy-3.8.14-cp312-cp312-macosx_11_0_arm64.whl.metadata (28 kB)
Collecting spacy-legacy<3.1.0,>=3.0.11 (from spacy)
Using cached spacy_legacy-3.0.12-py2.py3-none-any.whl.metadata (2.8 kB)
Collecting spacy-loggers<2.0.0,>=1.0.0 (from spacy)
Using cached spacy_loggers-1.0.5-py3-none-any.whl.metadata (23 kB)
Collecting murmurhash<1.1.0,>=0.28.0 (from spacy)
Using cached murmurhash-1.0.15-cp312-cp312-macosx_11_0_arm64.whl.metadata (2.3 kB)
Collecting cymem<2.1.0,>=2.0.2 (from spacy)
Using cached cymem-2.0.13-cp312-cp312-macosx_11_0_arm64.whl.metadata (9.7 kB)
Collecting preshed<3.1.0,>=3.0.2 (from spacy)
Using cached preshed-3.0.13-cp312-cp312-macosx_11_0_arm64.whl.metadata (5.2 kB)
Collecting thinc<8.4.0,>=8.3.12 (from spacy)
Using cached thinc-8.3.13-cp312-cp312-macosx_11_0_arm64.whl.metadata (14 kB)
Collecting wasabi<1.2.0,>=0.9.1 (from spacy)
Using cached wasabi-1.1.3-py3-none-any.whl.metadata (28 kB)
Collecting srsly<3.0.0,>=2.5.3 (from spacy)
Using cached srsly-2.5.3-cp312-cp312-macosx_11_0_arm64.whl.metadata (19 kB)
Collecting catalogue<2.1.0,>=2.0.6 (from spacy)
Using cached catalogue-2.0.10-py3-none-any.whl.metadata (14 kB)
Collecting weasel<2.0.0,>=1.0.0 (from spacy)
Using cached weasel-1.0.0-py3-none-any.whl.metadata (4.6 kB)
Collecting confection<2.0.0,>=1.3.2 (from spacy)
Using cached confection-1.3.3-py3-none-any.whl.metadata (19 kB)
Collecting typer<1.0.0,>=0.3.0 (from spacy)
Using cached typer-0.26.2-py3-none-any.whl.metadata (16 kB)
Collecting tqdm<5.0.0,>=4.38.0 (from spacy)
Using cached tqdm-4.67.3-py3-none-any.whl.metadata (57 kB)
Collecting numpy>=1.19.0 (from spacy)
Downloading numpy-2.4.6-cp312-cp312-macosx_14_0_arm64.whl.metadata (6.6 kB)
Collecting requests<3.0.0,>=2.13.0 (from spacy)
Downloading requests-2.34.2-py3-none-any.whl.metadata (4.8 kB)
Collecting pydantic<3.0.0,>=2.0.0 (from spacy)
Using cached pydantic-2.13.4-py3-none-any.whl.metadata (109 kB)
Collecting jinja2 (from spacy)
Using cached jinja2-3.1.6-py3-none-any.whl.metadata (2.9 kB)
Collecting setuptools (from spacy)
Using cached setuptools-82.0.1-py3-none-any.whl.metadata (6.5 kB)
Collecting packaging>=20.0 (from spacy)
Using cached packaging-26.2-py3-none-any.whl.metadata (3.5 kB)
Collecting annotated-types>=0.6.0 (from pydantic<3.0.0,>=2.0.0->spacy)
Using cached annotated_types-0.7.0-py3-none-any.whl.metadata (15 kB)
Collecting pydantic-core==2.46.4 (from pydantic<3.0.0,>=2.0.0->spacy)
Using cached pydantic_core-2.46.4-cp312-cp312-macosx_11_0_arm64.whl.metadata (6.6 kB)
Collecting typing-extensions>=4.14.1 (from pydantic<3.0.0,>=2.0.0->spacy)
Using cached typing_extensions-4.15.0-py3-none-any.whl.metadata (3.3 kB)
Collecting typing-inspection>=0.4.2 (from pydantic<3.0.0,>=2.0.0->spacy)
Using cached typing_inspection-0.4.2-py3-none-any.whl.metadata (2.6 kB)
Collecting charset_normalizer<4,>=2 (from requests<3.0.0,>=2.13.0->spacy)
Using cached charset_normalizer-3.4.7-cp312-cp312-macosx_10_13_universal2.whl.metadata (40 kB)
Collecting idna<4,>=2.5 (from requests<3.0.0,>=2.13.0->spacy)
Downloading idna-3.16-py3-none-any.whl.metadata (6.4 kB)
Collecting urllib3<3,>=1.26 (from requests<3.0.0,>=2.13.0->spacy)
Using cached urllib3-2.7.0-py3-none-any.whl.metadata (6.9 kB)
Collecting certifi>=2023.5.7 (from requests<3.0.0,>=2.13.0->spacy)
Downloading certifi-2026.5.20-py3-none-any.whl.metadata (2.5 kB)
Collecting blis<1.4.0,>=1.3.0 (from thinc<8.4.0,>=8.3.12->spacy)
Using cached blis-1.3.3-cp312-cp312-macosx_11_0_arm64.whl.metadata (7.5 kB)
Collecting shellingham>=1.3.0 (from typer<1.0.0,>=0.3.0->spacy)
Using cached shellingham-1.5.4-py2.py3-none-any.whl.metadata (3.5 kB)
Collecting rich>=13.8.0 (from typer<1.0.0,>=0.3.0->spacy)
Using cached rich-15.0.0-py3-none-any.whl.metadata (18 kB)
Collecting annotated-doc>=0.0.2 (from typer<1.0.0,>=0.3.0->spacy)
Using cached annotated_doc-0.0.4-py3-none-any.whl.metadata (6.6 kB)
Collecting cloudpathlib>=0.7.0 (from weasel<2.0.0,>=1.0.0->spacy)
Using cached cloudpathlib-0.24.0-py3-none-any.whl.metadata (16 kB)
Collecting smart-open>=5.2.1 (from weasel<2.0.0,>=1.0.0->spacy)
Downloading smart_open-7.6.1-py3-none-any.whl.metadata (25 kB)
Collecting httpx>=0.24.0 (from weasel<2.0.0,>=1.0.0->spacy)
Using cached httpx-0.28.1-py3-none-any.whl.metadata (7.1 kB)
Collecting anyio (from httpx>=0.24.0->weasel<2.0.0,>=1.0.0->spacy)
Using cached anyio-4.13.0-py3-none-any.whl.metadata (4.5 kB)
Collecting httpcore==1.* (from httpx>=0.24.0->weasel<2.0.0,>=1.0.0->spacy)
Using cached httpcore-1.0.9-py3-none-any.whl.metadata (21 kB)
Collecting h11>=0.16 (from httpcore==1.*->httpx>=0.24.0->weasel<2.0.0,>=1.0.0->spacy)
Using cached h11-0.16.0-py3-none-any.whl.metadata (8.3 kB)
Collecting markdown-it-py>=2.2.0 (from rich>=13.8.0->typer<1.0.0,>=0.3.0->spacy)
Using cached markdown_it_py-4.2.0-py3-none-any.whl.metadata (7.4 kB)
Collecting pygments<3.0.0,>=2.13.0 (from rich>=13.8.0->typer<1.0.0,>=0.3.0->spacy)
Using cached pygments-2.20.0-py3-none-any.whl.metadata (2.5 kB)
Collecting mdurl~=0.1 (from markdown-it-py>=2.2.0->rich>=13.8.0->typer<1.0.0,>=0.3.0->spacy)
Using cached mdurl-0.1.2-py3-none-any.whl.metadata (1.6 kB)
Collecting wrapt (from smart-open>=5.2.1->weasel<2.0.0,>=1.0.0->spacy)
Downloading wrapt-2.2.1-cp312-cp312-macosx_11_0_arm64.whl.metadata (7.4 kB)
Collecting MarkupSafe>=2.0 (from jinja2->spacy)
Using cached markupsafe-3.0.3-cp312-cp312-macosx_11_0_arm64.whl.metadata (2.7 kB)
Using cached spacy-3.8.14-cp312-cp312-macosx_11_0_arm64.whl (6.0 MB)
Using cached catalogue-2.0.10-py3-none-any.whl (17 kB)
Using cached confection-1.3.3-py3-none-any.whl (35 kB)
Using cached cymem-2.0.13-cp312-cp312-macosx_11_0_arm64.whl (42 kB)
Using cached murmurhash-1.0.15-cp312-cp312-macosx_11_0_arm64.whl (27 kB)
Using cached preshed-3.0.13-cp312-cp312-macosx_11_0_arm64.whl (138 kB)
Using cached pydantic-2.13.4-py3-none-any.whl (472 kB)
Using cached pydantic_core-2.46.4-cp312-cp312-macosx_11_0_arm64.whl (2.0 MB)
Downloading requests-2.34.2-py3-none-any.whl (73 kB)
Using cached charset_normalizer-3.4.7-cp312-cp312-macosx_10_13_universal2.whl (311 kB)
Downloading idna-3.16-py3-none-any.whl (74 kB)
Using cached spacy_legacy-3.0.12-py2.py3-none-any.whl (29 kB)
Using cached spacy_loggers-1.0.5-py3-none-any.whl (22 kB)
Using cached srsly-2.5.3-cp312-cp312-macosx_11_0_arm64.whl (658 kB)
Using cached thinc-8.3.13-cp312-cp312-macosx_11_0_arm64.whl (791 kB)
Using cached blis-1.3.3-cp312-cp312-macosx_11_0_arm64.whl (1.2 MB)
Downloading numpy-2.4.6-cp312-cp312-macosx_14_0_arm64.whl (5.2 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 5.2/5.2 MB 26.2 MB/s 0:00:00
Using cached tqdm-4.67.3-py3-none-any.whl (78 kB)
Using cached typer-0.26.2-py3-none-any.whl (123 kB)
Using cached urllib3-2.7.0-py3-none-any.whl (131 kB)
Using cached wasabi-1.1.3-py3-none-any.whl (27 kB)
Using cached weasel-1.0.0-py3-none-any.whl (50 kB)
Using cached annotated_doc-0.0.4-py3-none-any.whl (5.3 kB)
Using cached annotated_types-0.7.0-py3-none-any.whl (13 kB)
Downloading certifi-2026.5.20-py3-none-any.whl (134 kB)
Using cached cloudpathlib-0.24.0-py3-none-any.whl (63 kB)
Using cached httpx-0.28.1-py3-none-any.whl (73 kB)
Using cached httpcore-1.0.9-py3-none-any.whl (78 kB)
Using cached h11-0.16.0-py3-none-any.whl (37 kB)
Using cached packaging-26.2-py3-none-any.whl (100 kB)
Using cached rich-15.0.0-py3-none-any.whl (310 kB)
Using cached pygments-2.20.0-py3-none-any.whl (1.2 MB)
Using cached markdown_it_py-4.2.0-py3-none-any.whl (91 kB)
Using cached mdurl-0.1.2-py3-none-any.whl (10.0 kB)
Using cached shellingham-1.5.4-py2.py3-none-any.whl (9.8 kB)
Downloading smart_open-7.6.1-py3-none-any.whl (64 kB)
Using cached typing_extensions-4.15.0-py3-none-any.whl (44 kB)
Using cached typing_inspection-0.4.2-py3-none-any.whl (14 kB)
Using cached anyio-4.13.0-py3-none-any.whl (114 kB)
Using cached jinja2-3.1.6-py3-none-any.whl (134 kB)
Using cached markupsafe-3.0.3-cp312-cp312-macosx_11_0_arm64.whl (12 kB)
Using cached setuptools-82.0.1-py3-none-any.whl (1.0 MB)
Downloading wrapt-2.2.1-cp312-cp312-macosx_11_0_arm64.whl (81 kB)
Installing collected packages: wrapt, wasabi, urllib3, typing-extensions, tqdm, spacy-loggers, spacy-legacy, shellingham, setuptools, pygments, packaging, numpy, murmurhash, mdurl, MarkupSafe, idna, h11, cymem, confection, cloudpathlib, charset_normalizer, certifi, catalogue, annotated-types, annotated-doc, typing-inspection, srsly, smart-open, requests, pydantic-core, preshed, markdown-it-py, jinja2, httpcore, blis, anyio, rich, pydantic, httpx, typer, thinc, weasel, spacy
Successfully installed MarkupSafe-3.0.3 annotated-doc-0.0.4 annotated-types-0.7.0 anyio-4.13.0 blis-1.3.3 catalogue-2.0.10 certifi-2026.5.20 charset_normalizer-3.4.7 cloudpathlib-0.24.0 confection-1.3.3 cymem-2.0.13 h11-0.16.0 httpcore-1.0.9 httpx-0.28.1 idna-3.16 jinja2-3.1.6 markdown-it-py-4.2.0 mdurl-0.1.2 murmurhash-1.0.15 numpy-2.4.6 packaging-26.2 preshed-3.0.13 pydantic-2.13.4 pydantic-core-2.46.4 pygments-2.20.0 requests-2.34.2 rich-15.0.0 setuptools-82.0.1 shellingham-1.5.4 smart-open-7.6.1 spacy-3.8.14 spacy-legacy-3.0.12 spacy-loggers-1.0.5 srsly-2.5.3 thinc-8.3.13 tqdm-4.67.3 typer-0.26.2 typing-extensions-4.15.0 typing-inspection-0.4.2 urllib3-2.7.0 wasabi-1.1.3 weasel-1.0.0 wrapt-2.2.1
((.venv) ) martratas@Marts-MacBook-Pro 2026_05_27_spacy_click % python -c "import spacy"
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/Users/martratas/Documents/CogStack/.MedCAT.nosync/monorepo-nlp/medcat-v2/.temp/2026_05_27_spacy_click/.venv/lib/python3.12/site-packages/spacy/__init__.py", line 18, in <module>
from .cli.info import info # noqa: F401
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/martratas/Documents/CogStack/.MedCAT.nosync/monorepo-nlp/medcat-v2/.temp/2026_05_27_spacy_click/.venv/lib/python3.12/site-packages/spacy/cli/__init__.py", line 4, in <module>
from . import download as download_module # noqa: F401
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/martratas/Documents/CogStack/.MedCAT.nosync/monorepo-nlp/medcat-v2/.temp/2026_05_27_spacy_click/.venv/lib/python3.12/site-packages/spacy/cli/download.py", line 21, in <module>
from ._util import SDIST_SUFFIX, WHEEL_SUFFIX, Arg, Opt, app
File "/Users/martratas/Documents/CogStack/.MedCAT.nosync/monorepo-nlp/medcat-v2/.temp/2026_05_27_spacy_click/.venv/lib/python3.12/site-packages/spacy/cli/_util.py", line 18, in <module>
from click import NoSuchOption
ModuleNotFoundError: No module named 'click'
EDIT:
I think spacy has been relying on typer bringing in click. But as of typer==0.26.x, it looks like typer no longer depends on click. And as such it doesn't get installed anymore.
Reacted by Philip Bourke, mykhailo-saienko, Alex, Marcin Konowalczyk, Iago Soriano, J. R. Williams, Safrone, Orest Chura, Mike DePaulo, Avi Flax and 6 more
Metadata
Metadata
Assignees
Labels
No labels
Activity
[-]`spacy` fails to specify `click` as a dependency even though it is being used[/-][+]`spacy` fails to specify `click` as a dependency even though it is being used and thus fresh install + import fails[/+]mykhailo-saienko commentedon May 27, 2026
I can confirm this is a breaking regression on fresh installations/CI runners that triggered between May 20, 2026, and May 27, 2026.
Our CI builds using
spacy~=3.8.11(resolving to3.8.14) were passing flawlessly up until May 20, but began failing completely today with theModuleNotFoundError: No module named 'click'uponimport spacy.Root Cause / Log Analysis
Comparing our historical successful installation traces to today's failing traces reveals the exact downstream shift:
spacypulled downtyper-0.25.1, which explicitly mandatedclick>=8.2.1.spacypulled down the newly releasedtyper-0.26.2because spaCy’s internal constraint is wide (typer<1.0.0,>=0.3.0). In this newer version oftyper,clickwas decoupled and made an optional dependency.Because
import spacyeagerly callsfrom click import NoSuchOptionon initialization insidespacy/cli/_util.py, the entire library crashes on import in a naked environment.Workaround for other users hitting this today
Until a patch is released, you can fix your environment by explicitly forcing
clickback into your top-level project dependencies (requirements.txtorpyproject.toml):lczyk commentedon May 29, 2026
typer<0.26for validate-hints workflow canonical/chisel-releases#1018Add click back as dependency via spacy
add work-around for missing dependencies
sjhuskey commentedon Jul 14, 2026
I encountered the issue with missing
clickmodule today (July 14, 2026) on a fresh installation of spaCy (Mac OS 26.5.2 on an Apple M4 Pro).mhines-usgs commentedon Jul 16, 2026
Encountered July 15, setting up an r docker container. after this container is up and running, doing 'R -e 'spacyr::install_spacey()' causes the error
Dockerfile
see docker container create log
Then after it is downloaded I enter the container and:
fix: legacy-builder COPY --chmod incompatibility + missing click dep
kumestra commentedon Jul 23, 2026
I can reproduce this with
uvon Python 3.12 as well:The resolved set includes
spacy==3.8.14andtyper==0.27.0, but noclick. The command fails before the model download starts because importingspacy.cli._utilraises:Adding
clickexplicitly withuv add clickfixes the import/download path, so this matches the missing direct runtime dependency described above.cdjameson commentedon Aug 6, 2026
The fact that @svlandeg is the one that implemented the change in Typer while this breaking bug with a one-line fix languishes here in spaCy unreviewed for months is... confusing. I can't imagine I'm alone in not understanding what the present and future status of Explosion and spaCy looks like.
svlandeg commentedon Aug 6, 2026
Hi @cdjameson! I am not an active maintainer of spaCy anymore, and as such I do not merge any PRs here anymore.
I have added reviews to both relevant PRs though, and will ping Matt/Ines about this issue in case they haven't seen it here. Matt/Ines: let me know if I can help (more) with any of this.
Fix click dependency issue (#13971) (#13973)
honnibal commentedon Aug 6, 2026
I understand the frustration but unfortunately I simply missed this. I've merged the requirements change as Sofie recommended and am triggering a release.
honnibal commentedon Aug 6, 2026
Actions is down but will trigger a release when they're back up.
Install click with previous spaCy in upgrade test
cdjameson commentedon Aug 13, 2026
Thanks for the quick turnaround, everything works for our releases now! No frustration intended: Sofie addressed part of my confusion above—I had seen her commit to the repo as recently as March of this year and didn't understand that she was hands-off here—and if it's just you or even just you and Ines of course things are going to slip through unnoticed!
If I weren't changing job roles myself I would offer to help out more directly instead of just opening issues and seeming frustrated. Thanks for everything you do for spaCy, it's the backbone of our production NLP services!
github-actions commentedon Oct 27, 2026
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.