Invalid Notebook #188601
-
Select Topic AreaQuestion BodyWhen I tried to upload an .ipynb file it shows: I see some solutions but those are complex procedure. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
|
Remove metadata.widgets Open the .ipynb in a text editor. Delete the entire "widgets" section under "metadata". GitHub will render the notebook normally. Pros: Simple, fast, works for any notebook. Cons: Removes widget metadata (interactive widgets won’t work if reloaded elsewhere). |
Beta Was this translation helpful? Give feedback.
-
|
Most Easy way: Clear all cell outputs In Jupyter/Colab: Edit → Clear All Outputs. Save and push. GitHub can now render the notebook. Pros: Works without touching metadata. Cons: Viewers cannot see outputs unless they run the notebook. |
Beta Was this translation helpful? Give feedback.
-
|
This error happens because your notebook contains broken widget metadata. Specifically, metadata.widgets exists but the required state key is missing, and newer nbformat/nbconvert versions validate this strictly. If you’re not using ipywidgets, the easiest fix is: jupyter nbconvert --clear-output --inplace your_notebook.ipynb Then try uploading again. If it still fails, open the .ipynb file in a text editor and remove the entire "metadata.widgets" section. It’s safe to remove if you don’t need saved widget state. That should resolve it without complex steps. |
Beta Was this translation helpful? Give feedback.
Remove metadata.widgets
Open the .ipynb in a text editor.
Delete the entire "widgets" section under "metadata".
GitHub will render the notebook normally.
Pros: Simple, fast, works for any notebook.
Cons: Removes widget metadata (interactive widgets won’t work if reloaded elsewhere).