PyCharm & Python: Autoreload modules when in debug mode?

已回答

I've found that when in debug mode for a python application the modules do not reload automatically and the entire application has to be restarted for any changes to take affect. We've been looking at using PyCharm as a replacement to Eclipse, however the lack of this functionality is somewhat of a deal breaker for us as our application currently takes a significant amount of time to reload.

I've been searching for an answer to this for a few days now but I can't find anything concrete. Does this option exist and I'm just missing it in the Settings window? If not, are there any plans to implement this?

2

Hi Adammrutter,

Thank you for contacting PyCharm support.

Could you please provide more details? What steps are taken (scenario)?

What do you mean by "modules do not reload automatically"?

 

Kind regards,

Sergey

 

0
Avatar
Permanently deleted user

1) Start debugging a program.  It makes use of module "my.module"

2) make some changes to my/module/__init__.py

3) ???

4) debugger becomes aware of the changes

I note that it is a feature of IntelliJ IDEA to dynamically reload/hotswap classes.  Is this in any way available for python?  the "importlib.reload" function has no effect when the debugger is running.

0

This isn't possible to do for .py custom modules. There is an option for some frameworks (for Django I recall), but not for any module.

Please feel free to submit a feature request about it to our issue tracker using the link https://youtrack.jetbrains.com/issues/PY and let us know if you need any help.

0

Hello, is it still the same? ChatGPT is convinced that PyCharm can auto-reload my wsgiref.simple_server but I don't see options for that. I use Pro version.

0

请先登录再写评论。