user1561108
user1561108

Reputation: 2747

How do I reload this module?

from mypackage.pkg import mymodule
...
reload(mypackage.pkg.mymodule)

results in NameError: global name 'mypackage' is not defined.

How should mymodule be reloaded?

Upvotes: 2

Views: 73

Answers (1)

Eric
Eric

Reputation: 97565

from mypackage.pkg import mymodule

reload(mymodule)

or

import mypackage.pkg.mymodule
...
reload(mypackage.pkg.mymodule)

Upvotes: 8

Related Questions