Jupyter will not start: Validator got an unexpected keyword argument 'registry'
Your error
TypeError: create.<locals>.Validator.__init__() got an unexpected keyword argument 'registry'2 more lines it can showFix it fast
Most common cause, 1 of 2Another package pinned jsonschema below 4.18 and pip downgraded it
Upgrade jsonschema back to a current release in that environment.
python -m pip install -U "jsonschema[format-nongpl]>=4.18"
python -m pip checkShort answer
The TypeError create.<locals>.Validator.__init__() got an unexpected keyword argument 'registry' means jupyter_events passed registry= to a jsonschema older than 4.18, the release that added the referencing library. Either a package downgraded jsonschema, or an old copy in the user site-packages shadows the environment's. Upgrade or remove that copy. Applies to jupyter-events 0.12 and jsonschema 4.26.
Which cause do you have?
Use the same Python that runs Jupyter and ask two questions: which jsonschema version pip thinks is installed, and which file Python really imports. An old version in the environment is cause 1. A new version in the environment but an import path under ~/.local is cause 2.
python -m pip show jsonschema | grep -E "^(Version|Location)"
python -c "import jsonschema; print(jsonschema.__file__)"Then find the line you see in this list and open its fix:
- 1Another package pinned jsonschema below 4.18 and pip downgraded it
pip show prints Version: 4.17.x, and pip check names jupyter-events with a line ending in but you have jsonschema 4.17.x - 2An old jsonschema in the user site-packages shadows the new one
pip show in the environment reports 4.18 or later, yet jsonschema.__file__ points into ~/.local/lib/pythonX.Y/site-packages
What does the error look like?
TypeError: create.<locals>.Validator.__init__() got an unexpected keyword argument 'registry'File ".../site-packages/jupyter_events/validators.py", line 46, in <module>JUPYTER_EVENTS_SCHEMA_VALIDATOR = Draft7Validator(
Cause 1 of 2
Another package pinned jsonschema below 4.18 and pip downgraded it
You seepip show prints Version: 4.17.x, and pip check names jupyter-events with a line ending in but you have jsonschema 4.17.x
Check
The unexpected keyword 'registry' error appears when jsonschema is older than 4.18, while jupyter-events declares jsonschema[format-nongpl]>=4.18.0 and builds its Draft7Validator with registry=. Installing a library that pins jsonschema below 4.18 into the same environment downgrades it, and Jupyter breaks on the next start.
python -m pip checkFix
Upgrade jsonschema back to a current release in that environment. Install the package that needs the old pin into its own virtual environment instead of the Jupyter one, or upgrade it to a release that accepts newer jsonschema.
python -m pip install -U "jsonschema[format-nongpl]>=4.18"
python -m pip checkVerify
pip check prints No broken requirements found, and Jupyter starts and prints its version.
jupyter lab --versionConfirmed by raw.githubusercontent.com
Cause 2 of 2
An old jsonschema in the user site-packages shadows the new one
You seepip show in the environment reports 4.18 or later, yet jsonschema.__file__ points into ~/.local/lib/pythonX.Y/site-packages
Check
Even a fresh conda environment can still raise the registry TypeError when an old pip install --user copy exists. PEP 370 places the user site directory before the system site directories on sys.path, so that copy wins. A venv that does not include system site packages skips the user folder.
python -m site --user-siteFix
Confirm by starting Jupyter with the user folder switched off. If it starts, delete the old jsonschema folders from the path that python -m site --user-site printed, or keep PYTHONNOUSERSITE=1 set for that environment.
ls "$(python -m site --user-site)" | grep -i -E "jsonschema|referencing"
PYTHONNOUSERSITE=1 jupyter labVerify
jsonschema.__file__ now points inside the environment's own site-packages, and Jupyter starts without the TypeError.
python -c "import jsonschema; print(jsonschema.__file__)"Confirmed by peps.python.org
How do I stop it coming back?
- Give Jupyter its own virtual environment and install project libraries with strict old pins elsewhere.
- Run python -m pip check after every pip install in a Jupyter environment, and fail CI images on its exit code.
- Avoid pip install --user on machines that also use conda or system Python for Jupyter.
Sources
How was this page made?
I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.