You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Then it does indeed pick it up changes each time. Unfortunately, this doesn't work for the from X import Y style, since the reference to the module containing the imported item isn't in scope to pass to reload.
Is it possible that ipynb could watch timestamps on the imported files and handle this under the hood when the imported file changes? Thanks for a great project!
/opt/anaconda3/envs/ml/lib/python3.7/importlib/init.py in reload(module)
138 """
139 if not module or not isinstance(module, types.ModuleType):
--> 140 raise TypeError("reload() argument must be a module")
141 try:
142 name = module.spec.name
TypeError: reload() argument must be a module
I got this error when I try to reload one function under my helper_fun.ipynb file when I ran
from ipynb.fs.defs.helper_fun import add_num
from importlib import reload
reload(add_num)
Activity
Carreau commentedon Feb 28, 2018
Thanks for opening the issue and the nice comments.
We don't have a lot of bandwidth to work on this project so it has not moved forward a lot.
One of the limitation here is the one of Python's import, and I am not familiar enough with the internal to know whether what you ask is possible.
In JupyterLab you should be able to attach the same kernel to both notebook, which might help mitigate the issue.
michael-pont commentedon Jan 10, 2019
I got the same error when trying to change and save the file where my helper functions were defined within Jupyter Notebooks.
Rerunning the below line in a jupyter cell would not reload the newly saved functions.
@mikepurvis solution worked for me. I ran:
inspirepassion commentedon Nov 5, 2019
/opt/anaconda3/envs/ml/lib/python3.7/importlib/init.py in reload(module)
138 """
139 if not module or not isinstance(module, types.ModuleType):
--> 140 raise TypeError("reload() argument must be a module")
141 try:
142 name = module.spec.name
TypeError: reload() argument must be a module
I got this error when I try to reload one function under my helper_fun.ipynb file when I ran
Add backports for capturing output and a parameterization function. (i…