Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
Frank-Steiner opened this issue Apr 5, 2023 · 3 comments · Fixed by #372
Closed

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

Frank-Steiner opened this issue Apr 5, 2023 · 3 comments · Fixed by #372

Comments

@Frank-Steiner
Copy link

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: jupyterlite/xeus-python-kernel#120

cu,
Frank

@dsuess
Copy link

dsuess commented Apr 27, 2023

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
Copy link
Author

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
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants