jupyter / nbformat

Reference implementation of the Jupyter Notebook format
http://nbformat.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
269 stars 152 forks source link

5.8.0 gives TypeError: expected string or bytes-like object #358

Closed Frank-Steiner closed 1 year ago

Frank-Steiner commented 1 year ago

After updating our jupyterhub installation it failed to startup due to a TypeError caused by the nbformat package. And it fails indeed also outside jupyterhub:

bioserver2:/opt/jhub # pip3.10 freeze |grep nbformat nbformat==5.8.0

bioserver2:/opt/jhub # python3.10 Python 3.10.10 (main, Mar 05 2023, 19:07:49) [GCC] on linux Type "help", "copyright", "credits" or "license" for more information.

import nbformat Traceback (most recent call last): File "", line 1, in File "/opt/jhub/lib/python3.10/site-packages/nbformat/init.py", line 12, in from ._version import version, version_info File "/opt/jhub/lib/python3.10/site-packages/nbformat/_version.py", line 28, in _version_fields = _version_regex.match(version).groupdict() # type:ignore TypeError: expected string or bytes-like object

Same problem is reported here: https://github.com/jupyterlite/xeus-python-kernel/issues/120

cu, Frank

dsuess commented 1 year ago

I've run into the same issue using conda: The reason is there are two packages importlib-metadata and importlib_metadata. If they're installed in this order, I get the above error. However, if they're installed in the opposite order everything works fine...

Frank-Steiner commented 1 year ago

We have neither of these installed. But for some magical reason the problem has disappeared. When I install the same version of jupyterhub (3.1.1) today I don't get the problem anymore. So according to your comment I guess that some other package has changed something so that nbformat 5.8.0 now works (and it's not importlib-metadata or importlib_metadata as they are not in site-packages...).

Nice for us, but unsatisfying not to know the reason...

elac-safran commented 1 year ago

Hello everyone. For information, I have just stumbled on the same error with nbformat 5.9.