Repository navigation
Closed
Description
Noticed the following error on the CI runs, might be due to pydantic incompatibility ?
How to reproduce the behaviour
from spacy.language import LanguageTraceback
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
from spacy.language import Language
File "/workspaces/test.venv/lib/python3.14/site-packages/spacy/__init__.py", line 13, in <module>
from . import pipeline # noqa: F401
^^^^^^^^^^^^^^^^^^^^^^
File "/workspaces/test.venv/lib/python3.14/site-packages/spacy/pipeline/__init__.py", line 1, in <module>
from .attributeruler import AttributeRuler
File "/workspaces/test/.venv/lib/python3.14/site-packages/spacy/pipeline/attributeruler.py", line 10, in <module>
from ..language import Language
File "/workspaces/test/.venv/lib/python3.14/site-packages/spacy/language.py", line 46, in <module>
from .pipe_analysis import analyze_pipes, print_pipe_analysis, validate_attrs
File "/workspaces/test/.venv/lib/python3.14/site-packages/spacy/pipe_analysis.py", line 6, in <module>
from .tokens import Doc, Span, Token
File "/workspaces/test/.venv/lib/python3.14/site-packages/spacy/tokens/__init__.py", line 1, in <module>
from ._serialize import DocBin
File "/workspaces/test/.venv/lib/python3.14/site-packages/spacy/tokens/_serialize.py", line 14, in <module>
from ..vocab import Vocab
File "spacy/vocab.pyx", line 1, in init spacy.vocab
File "spacy/tokens/doc.pyx", line 49, in init spacy.tokens.doc
File "/workspaces/test/.venv/lib/python3.14/site-packages/spacy/schemas.py", line 195, in <module>
class TokenPatternString(BaseModel):
...<43 lines>...
return v
File "/workspaces/test/.venv/lib/python3.14/site-packages/pydantic/v1/main.py", line 221, in __new__
inferred = ModelField.infer(
name=var_name,
...<3 lines>...
config=config,
)
File "/workspaces/test/.venv/lib/python3.14/site-packages/pydantic/v1/fields.py", line 504, in infer
return cls(
name=name,
...<7 lines>...
field_info=field_info,
)
File "/workspaces/test/.venv/lib/python3.14/site-packages/pydantic/v1/fields.py", line 434, in __init__
self.prepare()
~~~~~~~~~~~~^^
File "/workspaces/test/.venv/lib/python3.14/site-packages/pydantic/v1/fields.py", line 544, in prepare
self._set_default_and_type()
~~~~~~~~~~~~~~~~~~~~~~~~~~^^
File "/workspaces/test/.venv/lib/python3.14/site-packages/pydantic/v1/fields.py", line 576, in _set_default_and_type
raise errors_.ConfigError(f'unable to infer type for attribute "{self.name}"')
pydantic.v1.errors.ConfigError: unable to infer type for attribute "REGEX"Your Environment
- Operating System: ubuntu-latest
- Python Version Used: 3.14
- spaCy Version Used: 3.8.10
Reacted by Garret Meier, Dillon Wong, nndnha, OlafCzyz, Julien Bourque, Philip Khor, Asaf, Matthew Martin, Stephane Martin, Christophe Bornet and 15 more
Reacted by Rene Leonhardt and Narcélio
Metadata
Metadata
Assignees
Labels
No labels
Activity
korobovsp commentedon Nov 18, 2025
C:\Users\bal1web\AppData\Local\Programs\Python\Python314\Lib\site-packages\confection_init_.py:38: UserWarning: Core Pydantic V1 functionality isn't compatible with Python 3.14 or greater.
from pydantic.v1 import BaseModel, Extra, ValidationError, create_model
Traceback (most recent call last):
File "C:\bal1web\sintax.py", line 2, in
import spacy
File "C:\Users\bal1web\AppData\Local\Programs\Python\Python314\Lib\site-packages\spacy_init_.py", line 13, in
from . import pipeline # noqa: F401
^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\bal1web\AppData\Local\Programs\Python\Python314\Lib\site-packages\spacy\pipeline_init_.py", line 1, in
from .attributeruler import AttributeRuler
File "C:\Users\bal1web\AppData\Local\Programs\Python\Python314\Lib\site-packages\spacy\pipeline\attributeruler.py", line 10, in
from ..language import Language
File "C:\Users\bal1web\AppData\Local\Programs\Python\Python314\Lib\site-packages\spacy\language.py", line 46, in
from .pipe_analysis import analyze_pipes, print_pipe_analysis, validate_attrs
File "C:\Users\bal1web\AppData\Local\Programs\Python\Python314\Lib\site-packages\spacy\pipe_analysis.py", line 6, in
from .tokens import Doc, Span, Token
File "C:\Users\bal1web\AppData\Local\Programs\Python\Python314\Lib\site-packages\spacy\tokens_init_.py", line 1, in
from ._serialize import DocBin
File "C:\Users\bal1web\AppData\Local\Programs\Python\Python314\Lib\site-packages\spacy\tokens_serialize.py", line 14, in
from ..vocab import Vocab
File "spacy/vocab.pyx", line 1, in init spacy.vocab
File "spacy/tokens/doc.pyx", line 49, in init spacy.tokens.doc
File "C:\Users\bal1web\AppData\Local\Programs\Python\Python314\Lib\site-packages\spacy\schemas.py", line 195, in
class TokenPatternString(BaseModel):
...<43 lines>...
return v
File "C:\Users\bal1web\AppData\Local\Programs\Python\Python314\Lib\site-packages\pydantic\v1\main.py", line 221, in new
inferred = ModelField.infer(
name=var_name,
...<3 lines>...
config=config,
)
File "C:\Users\bal1web\AppData\Local\Programs\Python\Python314\Lib\site-packages\pydantic\v1\fields.py", line 504, in infer
return cls(
name=name,
...<7 lines>...
field_info=field_info,
)
File "C:\Users\bal1web\AppData\Local\Programs\Python\Python314\Lib\site-packages\pydantic\v1\fields.py", line 434, in init
self.prepare()
~~~~~~~~~~~~^^
File "C:\Users\bal1web\AppData\Local\Programs\Python\Python314\Lib\site-packages\pydantic\v1\fields.py", line 544, in prepare
self._set_default_and_type()
~~~~~~~~~~~~~~~~~~~~~~~~~~^^
File "C:\Users\bal1web\AppData\Local\Programs\Python\Python314\Lib\site-packages\pydantic\v1\fields.py", line 576, in set_default_and_type
raise errors.ConfigError(f'unable to infer type for attribute "{self.name}"')
pydantic.v1.errors.ConfigError: unable to infer type for attribute "REGEX"
[-]bug: pydantic v1 incompatability[/-][+]bug: pydantic v1 incompatability error (Py3.14 wheels)[/+]ghmeier commentedon Nov 26, 2025
Hey, just want to add on here that spacy isn't functional on Python 3.14 because of this issue. There's a more detailed synopsis here: pydantic/pydantic#12363, but the
pydantic.v1namespace on pydantic>=2.0.0 doesn't support Python 3.14. Similarly,pydantic<2.0.0doesn't support Python 3.14 at all.ghmeier commentedon Dec 20, 2025
For folks following along, Pydantic merged an update to v1 that supports 3.14: pydantic/pydantic#12636. That version of v1 should be included in pydantic v2.13 when that's released in a few weeks.
bvolkmer commentedon Jan 5, 2026
Wouldn't this be the moment to seriously consider upgrading to Pydantic v2? As v1 will cease to be supported eventually. For 3.14 it already wasn't planned (even though it was now implemented, but with the v2 release still pending)
chamalgomes commentedon Feb 23, 2026
@ghmeier latest Pydantic pre-release has a minor issue with version but the code is the latest and it still does not resolve the above issue. pydantic/pydantic#12852
fix: keep python 3.13 for PII checks until spaCy fix
fix: keep python 3.13 for PII checks until spaCy fix
ghmeier commentedon Mar 19, 2026
Dang, I think they still haven't released the new minor version outside the beta... I'd still be open to pushing my open PRs to resolve this issue more holistically:
Just need some input from the maintainers unfortunately.
honnibal commentedon Mar 20, 2026
Sorry about this. Working on it.
honnibal commentedon Mar 20, 2026
Okay confection v1 and new weasel are up. I'll try an updated build in spaCy now.
honnibal commentedon Mar 23, 2026
Python 3.14 and Pydantic v2 support now finally up
dwvisser commentedon Mar 23, 2026
still generates a Traceback on spacy 3.8.12 in Python 3.14:
jonbuffington commentedon Mar 23, 2026
@honnibal Thanks for making the changes! In addition to @dwvisser 's report,
spacyv3.18.12 no longer works when usingpydanticv2.13.0b2 and the model,en_core_web_md:dwvisser commentedon Mar 23, 2026
I found that both
uv pip installand regularpip installwere installing an old version of weasel (0.4.3) for some reason. When I manually diduv pip install "weasel>=1.0", the problem resolved.jonbuffington commentedon Mar 23, 2026
@dwvisser The package metadata has
weasel>=0.4.2,<0.5.0although spacy's master branchrequirements.txthasweasel>=1.0.0,<2.0.0.E.g., uv's output:
dwvisser commentedon Mar 23, 2026
Yup. I see that too:
honnibal commentedon Mar 23, 2026
That's odd, the setup.cfg has weasel 1.0 too. Let me figure out where I messed this up, sorry
honnibal commentedon Mar 23, 2026
The correct version is 3.8.13, did you update? I yanked the 3.8.12 release shortly after publishing it. I'm seeing the right meta here:
⎿ Name: spacy
Version: 3.8.13
Requires-Dist: spacy-legacy<3.1.0,>=3.0.11
Requires-Dist: spacy-loggers<2.0.0,>=1.0.0
Requires-Dist: murmurhash<1.1.0,>=0.28.0
Requires-Dist: cymem<2.1.0,>=2.0.2
Requires-Dist: preshed<3.1.0,>=3.0.2
Requires-Dist: thinc<8.4.0,>=8.3.12
Requires-Dist: wasabi<1.2.0,>=0.9.1
Requires-Dist: srsly<3.0.0,>=2.5.3
Requires-Dist: catalogue<2.1.0,>=2.0.6
Requires-Dist: weasel<2.0.0,>=1.0.0
Requires-Dist: confection<2.0.0,>=1.3.2
Requires-Dist: typer<1.0.0,>=0.3.0
Requires-Dist: tqdm<5.0.0,>=4.38.0
Requires-Dist: numpy>=1.15.0; python_version < "3.9"
Requires-Dist: numpy>=1.19.0; python_version >= "3.9"
Requires-Dist: requests<3.0.0,>=2.13.0
Requires-Dist: pydantic<3.0.0,>=2.0.0
jonbuffington commentedon Mar 23, 2026
@honnibal I was trying 3.8.12 as 3.8.13 was not available to me yet. 3.8.13 does work for me as I just tried it. Thanks again!
github-actions commentedon Apr 23, 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.