Pycharm not updating changes in imported files

I have a file say, main.py that executes code calling other functions, saved in other files, for instance myfunctions.py

so the main file looks like this:

#main.py
from myfunctions.py import function1, function2
a, b, c = 1, 2, 3
example = function1(a, b, c)

and the myfunctions file looks like this:

 

#myfunctions.py
import numpy as np

def function1(a, b, c):
return a*b*c

Now, if I run this once in the python console, it works fine. If now I go to the myfunctions.py and change it, say like this:

#myfunctions.py
import numpy as np

def function1(a, b, c):
print('change here')
return a*b*c

 

and I rerun the main file, the changes are not saved. This started to happen after I updated to pycharm PyCharm 2022.2 (Community Edition). THank you so much for a great editor and for your help!

0

Hi, where are you navigated to if using "go to declaration" on myfunctions in main.py?
https://www.jetbrains.com/help/pycharm/navigating-through-the-source-code.html#go_to_declaration

Are both files located in the same project directory?

0

I am taken to the correct function in myfunctions.py

The files are located in the same project directory. Upon further inspection, other projects do not have this same problem so I feel the issue arose because I created an empty project and then copied files from another one into this one. 

0

请先登录再写评论。