I have a jupyter notebook file1.ipynb, with file2.py containing function myfunc, in the same directory. The notebook is basically a demo on use of the functions in file2. I'm able to have a code cell in the notebook:
from file2 import myfunc
When running this notebook using a kernel on the local computer, it's fine. However, when using a kernel on a remote server, I get a ModuleNotFoundError. I don't feel too surprised about this, but, is there any workaround?
A couple very rough ones are
- copying the file2.py contents into an earlier cell block in the notebook and not performing an import
- copying file2.py onto the server's file system (somewhere on the existing path, or modifying the path)
- create a proper python module from file2 and publish and install it on the server
Those are all pretty poor options right now. The third one is probably the best-practices approach but a higher LOE especially while in development.