- #1
fog37
- 1,569
- 108
- TL;DR Summary
- import instruction in Jupyter notebook not working with module with .ipynb extension
Hello everyone,
I am writing Jupyter notebooks which are essentially JSON files. I wrote a custom module called module001 containing some functions and saved it as a .ipynb file. Upon importing the module into a different notebook using the instruction import module001, I received the error that the module was not found. I eventually solved the problem by converting the .ipynb module into a .py script and then placing the module and the script in the same folder. The import worked just fine. The lesson learned was that the module, as .ipynb, does not work with the import instruction.
Are there other more elegant or efficient ways to solve this issue instead of having to convert the notebook module to .py?
Thank you!
I am writing Jupyter notebooks which are essentially JSON files. I wrote a custom module called module001 containing some functions and saved it as a .ipynb file. Upon importing the module into a different notebook using the instruction import module001, I received the error that the module was not found. I eventually solved the problem by converting the .ipynb module into a .py script and then placing the module and the script in the same folder. The import worked just fine. The lesson learned was that the module, as .ipynb, does not work with the import instruction.
Are there other more elegant or efficient ways to solve this issue instead of having to convert the notebook module to .py?
Thank you!