0

I have a file named "dependencies.py" in a new spyder project A in a folder.

I have also a file "dependencies.py" in a different earlier spyder project B in a different folder.

Whenever I import the file "dependencies.py" from a file in project A the module "dependencies.py" from project B gets imported.

I use :
from dependencies import *

How to rectify this?

Edit : I donot want to change the name of the files.

Edit 2 : Is there a way i can force spyder to reload a module before execution?

pppp_prs
  • 106
  • 1
  • 8
  • Have you checked Spyder's preferences, in particular **Run > Working directory settings**? What do you get if you put `print(os.getcwd())` just before the `import` line? – nekomatic Jun 01 '23 at 15:31
  • @nekomatic Yes i have checked it. It returns the correct folder. I think spyder/python is caching the file and storing it somewhere and using that file. – pppp_prs Jun 02 '23 at 03:54
  • Does this answer your question? [How do I unload (reload) a Python module?](https://stackoverflow.com/questions/437589/how-do-i-unload-reload-a-python-module) – Ahmed AEK Jun 02 '23 at 08:37
  • Have you tried to tune your sys.path ? – manu190466 Jun 02 '23 at 08:56

0 Answers0