VSCode Pylance 自动导入仅提示输入

VSCode Pylance auto import only prompt for typing

我正在使用 vscode pythonpylance extension。半个月前,一切都很好,当我输入 pandas 而不导入它时,我可以按 cmd + . 显示快速修复,但现在我不能。此外,pylance 说它有一个 auto import 功能,但是,它只会自动导入与 typing 包相关的任何内容。

我是否应该修改 pylance stubpath,因为它现在默认为键入?

Pylance 的“quick fix”和“auto import”函数可用。显示默认使用过的模块,尤其是当前项目中的文件已经使用过该模块。

建议您禁用其他不相关的扩展以避免扩展之间的干扰。另外,请尝试重新安装扩展程序“Pylance”并重新加载VSCode.

参考:Auto-import doesn't work.