You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Tried the other applicable steps from the Troubleshooting Guide
Completed the Problem Description, Steps to Reproduce and Version sections below
Problem Description
I am experiencing that Spyder UMR does not reload modules, when import these modules as an entire .py file.
So, for instance, in my project, I have a folder called "Modules".
In this folder I have several .py files, which I use as different modules in my project.
If I import a specific function (my_func) within a module (my_module.py file located in the Modules folder), using:
from Modules.my_module import my_func
The UMR manages to reload the my_module every time.
If I just import the module directly using:
from Modules import my_module
The UMR does not reload the my_module module
These modules typically contain more than one function, so it convenient for me to import an entire module instead of importing the specific functions within the module.
Is there a way to fix this, or do I have to import the functions individually, to get the UMR function to work as intended?
What steps reproduce the problem?
from Modules import my_module
run whatever script that is using my_module
What is the expected output? What do you see instead?
I expected that my_module is being reloaded every time I run the script, which then uses my_module.my_func() at some point.
But this is only the case, when I import the function specifically as from Modules.my_module import my_func
Versions
Spyder version: 5.3.3
Python version: 3.10.9
Qt version: 5.15.2
PyQt version: 5.15.7
Operating System name/version: Windows 10
The text was updated successfully, but these errors were encountered:
Hi @Jesperten and @hbengtsson sorry for such a late response! Checked this with the latest Spyder version (6.0.4 as I write this) and I was able to reproduce this using the UMR feature.
Further checking, seems like disabling UMR (Preferences > Python interpreter > User Module Reloader (UMR)) and instead using the IPython console Autoreload option (Preferences > IPython console > Advanced settings > Autoreload) should be enough to be able to reload modules used in the from Modules import my_module to use functions using my_module.my_func():
Issue Report Checklist
conda update spyder
(orpip
, if not using Anaconda)jupyter qtconsole
(if console-related)spyder --reset
Problem Description
I am experiencing that Spyder UMR does not reload modules, when import these modules as an entire .py file.
So, for instance, in my project, I have a folder called "Modules".
In this folder I have several .py files, which I use as different modules in my project.
If I import a specific function (my_func) within a module (my_module.py file located in the Modules folder), using:
from Modules.my_module import my_func
The UMR manages to reload the my_module every time.
If I just import the module directly using:
from Modules import my_module
The UMR does not reload the my_module module
These modules typically contain more than one function, so it convenient for me to import an entire module instead of importing the specific functions within the module.
Is there a way to fix this, or do I have to import the functions individually, to get the UMR function to work as intended?
What steps reproduce the problem?
from Modules import my_module
What is the expected output? What do you see instead?
I expected that my_module is being reloaded every time I run the script, which then uses
my_module.my_func()
at some point.But this is only the case, when I import the function specifically as
from Modules.my_module import my_func
Versions
The text was updated successfully, but these errors were encountered: