0

I have a python module that I have added a new file to. When I try to import the new file as

from my_module.new_file import new_class

it throws up an import error, where as the same thing works fine for the original files that were in there.

I'm sure this is down to the module being cached somewhere, and not updating the cache (if I remove the module folder completely importing the original code still works).

Can someone tell me where python 3.6 caches modules, how to remove the cached module, or force python to load the new file into the module.

abinitio
  • 609
  • 6
  • 20

1 Answers1

0

Found the answer:

import importlib
importlib.reload(my_module)
abinitio
  • 609
  • 6
  • 20