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

Error: Unsupported nbformat version 5 when opening Jupyter Notebook #407

Open
rezadrian01 opened this issue Jan 5, 2025 · 1 comment
Open

Comments

@rezadrian01
Copy link

I encountered an issue while trying to open a Jupyter Notebook file in the terminal. When attempting to open an .ipynb file, the following error message appears:
File Load Error for file.ipynb: Unreadable Notebook: path_to_file NBFormatError('Unsupported nbformat version 5')
Has anyone else experienced this issue or found a solution?

@gabemorris12
Copy link

I've experienced this issue. This error is comes when jupyter processes an empty .ipynb file. If you make the file from the jupyter interface, it should not create a blank file and have something like this:

{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "c3a19e18-06bd-4d5a-8a57-17c3cb898830",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.13.1"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}

The temporary fix for this would be to change the nbformat and nbformat_minor values to what I have shown above. You can open it in notepad or whatever you use to edit text files. I think that nbformat needs to be able to process version 5 or the jupyter peripheral responsible for processing an initially empty file and generating the values for these keys needs to change to 4 and 5.

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

No branches or pull requests

2 participants