PyCharm removes unused imports when moving a file
I'm using Pycharm for moving files inside my project and PyCharm updates the imports in the project to the new path which is great.
The problem is that it also removes unused imports from those files. This is a very bad behavior for me and I can't find a way to stop this.
I can't check whether it did that every time because sometimes its hundreds of files.
请先登录再写评论。
Hi,
Unfortunately, this appears to be a known issue: PY-54707. Please vote for it in order to be updated on resolution.
Also discussed in this thread: https://intellij-support.jetbrains.com/hc/en-us/community/posts/115000035164-Unconfigurable-Auto-Remove-of-Unused-Python-Imports.
Please try adding this comment to protect the following import from removal: