As many others, I am running into the issue of PyCharm not using the newer version of a function in a different file when the function is imported into a .ipynb. The behaviour is as follows: I run the ipynb, importing the function. I change the function in a seperate .py file. I rerun the ipynb and the unchanged version of the function is still in use. I tried to fix this with the proposed fix found here: https://stackoverflow.com/a/60099037/5587736. However, this doesn't change anything. I need help running through this, because this fix seems to work for others.
Asked
Active
Viewed 591 times
0
-
are you opening .ipynb in PyCharm? – darth baba Nov 26 '21 at 09:50
-
Yes, I edit both the ipynb and py files in PyCharm, and use PyCharm to run the interactive cells in the ipynb. – Kroshtan Nov 26 '21 at 09:54
-
Add ```%load_ext autoreload \n %autoreload 2``` at the top of the ipynb and then you can try running the modified function – darth baba Nov 26 '21 at 09:55
-
At the top meaning in the first cell? Or above the first cell? – Kroshtan Nov 26 '21 at 09:57
-
First cell should be fine actually – darth baba Nov 26 '21 at 10:15