可以使用以下方法: 点击菜单栏的 File -> Invalidate Caches / Restart。 在弹出的对话框中点击 Invalidate and Restart PyCharm 会重启并清理缓存和日志文件。