简体   繁体   English

jupyter notebook无法更新模块文件

[英]jupyter notebook cannot update module file

I do not have a code here as this is some general question. 我这里没有代码,因为这是一些一般性问题。

When I modified and saved a py file which was imported in a Jupiter notebook, even I import the module again, I cannot get the updates in the notebook work, what should I do? 当我修改并保存了在Jupiter笔记本中导入的py文件时,即使再次导入该模块,也无法在笔记本工作中获得更新,我该怎么办? (I usually shut down the work, but it is apparently inefficient) (我通常会关闭工作,但是效率很低)

importlib should still work. importlib应该仍然可以工作。 Quoting from a similar solution but concerning the interpreter: 引用类似的解决方案,但涉及解释器:

Python3 >= 3.4: importlib.reload(packagename) Python3> = 3.4: importlib.reload(packagename)

Python3 < 3.4: imp.reload(packagename) Python3 <3.4: imp.reload(packagename)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM