grst / nbimporter

Import ipython notebooks as modules
BSD 3-Clause "New" or "Revised" License
59 stars 9 forks source link

Notebooks created with spyder-notebook (0.3.0) cannot be imported because of "python3" kernelspec #10

Closed versionbayjc closed 4 years ago

versionbayjc commented 4 years ago

When I tried to import a notebook that was created with spyder-notebook (0.3.0), the nbimporter errors out with the message: "Ignoring 'ExampleNotebook2.ipynb': not a python notebook."

The main difference between a working (from VS Code) and a non-working (from spyder-notebook) notebook is the metadata.kernelspec.language field. For the working notebook this is "python" and the notebook from spyder-notebook has "python3": "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, vs "metadata": { "kernelspec": { "display_name": "Python 3 (Spyder)", "language": "python3", "name": "python3" }, I'm not sure if this is a bug in spyder-notebook, but maybe nbimporter can just accept both versions. I'll create a pull request for this :)