Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
from mypackage.pkg import mymodule ... reload(mypackage.pkg.mymodule)
结果是NameError: global name 'mypackage' is not defined.
NameError: global name 'mypackage' is not defined.
应该如何重新加载 mymodule?
from mypackage.pkg import mymodule reload(mymodule)
或者
import mypackage.pkg.mymodule ... reload(mypackage.pkg.mymodule)