首页 > 解决方案 > 自动完成在 Visual Studio Code python 中不起作用

问题描述

我知道有很多类似的问题,但没有一个对我有用。我在 Visual Studio Code 中的自动完成功能刚刚停止工作。

在此处输入图像描述

我正在使用来自 Anaconda3 发行版的 python 3.7.4。

我还安装了 python 扩展。

以下是我settings.json在 Visual Studio Code 中的内容:

设置.json

{
    "python.dataScience.sendSelectionToInteractiveWindow": true,
    "python.dataScience.askForKernelRestart": false,
    "editor.fontFamily": "Fira Code",
    "editor.fontLigatures": true,
    "python.pythonPath": "C:\\Program Files\\Anaconda3\\python.exe",
    "terminal.integrated.shell.windows": "C:\\Windows\\System32\\cmd.exe",
    "python.linting.enabled": false,
    "editor.tabCompletion": "on",
    "files.autoSave": "afterDelay",
    "files.autoSaveDelay": 500,
    "python.formatting.provider": "black",
    "python.linting.pylintEnabled": true,
    "python.linting.flake8Enabled": true,
}

我已经尝试卸载并重新安装 Visual Studio Code,但没有成功,并且与 Python 扩展相同......

无法弄清楚是什么问题。

感谢任何帮助。


更新

在此处输入图像描述

我刚刚注意到我的 python 解释器没有在 conda 环境中激活。这可能是问题吗?不应该Python 3.7.4 ('base':conda)在 Visual Studio Code 中使用 Python 环境中所示吗?

在此处输入图像描述

标签: pythonvisual-studio-codeautocomplete

解决方案


推荐阅读