0

Reloading modules in a Juypter notebook with autoreload - as shown in this this video - does not work on my local WinPython distribution (3.8.5 or 3.10.9).

However on Linux is does work. Might the problem be WinPython?

More specifically I have a file my_new_file.py:

print("import my_new_file.py")

def my_function():
    print("bar")

and a notebook in the same directory:

# Cell 1:
%load_ext autoreload
%autoreload 2

# Cell 2:
from my_new_file import my_function # Outputs: "import my_new_file.py".

# Cell 3:
my_function() # Outputs "bar".

# Cell 4:
# Before running this cell, I changed my_function()
# in my_new_file.py to return "foo" instead of "bar".
my_function() # Outputs "bar" instead of "foo".
  • Can you explain what means "does not work"? What is the issue? Which logs do you have? – Elikill58 May 02 '23 at 11:29
  • With "does not work", I mean that modules, which I update, are not updated in the notebook in which I use them. In other words using `%autoreload 2` has no affect. – johnny1357 May 03 '23 at 06:19
  • Yes but can you [edit] your post to add details as error/logs? Also, saying something doesn't work because the result isn't what expected isn't an explaination – Elikill58 May 03 '23 at 06:23
  • There are no errors and I wouldn't know how to produce logs. However, I adapted the post above. Maybe you can hint what I can do to produce logs. – johnny1357 May 05 '23 at 08:22

0 Answers0