简体   繁体   English

在 vscode 中更新 conda 环境时重新扫描智能感知

[英]Rescan intellisense when conda environment is updated in vscode

I have just started using vscode for Python (ML) development.我刚刚开始使用 vscode 进行 Python (ML) 开发。 One thing I am unable to figure out is how to set vscode's intellisense refresh if the conda environment is updates.我无法弄清楚的一件事是,如果 conda 环境更新,如何设置 vscode 的智能感知刷新。

eg Created a new workspace with a python interpreter from a conda environment.例如,在 conda 环境中使用 python 解释器创建了一个新工作区。 The environment.yml as conda and pip packages. environment.yml作为 conda 和 pip 包。 In the middle of my work, if I update the yml file and update the conda environment with conda env update -f environment.yml I want vscode to update it's intellisense and the workspace as well so that I don't get symbol/import not found errors from the newly installed package.在我的工作中间,如果我更新 yml 文件并使用conda env update -f environment.yml更新 conda conda env update -f environment.yml我希望 vscode 更新它的智能感知和工作区,这样我就不会得到符号/导入从新安装的包中发现错误。 I know that with PyCharm you could set it such that the symbols would be reloaded.我知道使用 PyCharm 您可以设置它以便重新加载符号。

I'm not sure if this is the most efficient way, but there is a command to reload the window, which has the effect of reloading the Python extension and rescanning the libraries.我不确定这是否是最有效的方法,但是有一个重新加载窗口的命令,它具有重新加载 Python 扩展和重新扫描库的效果。 Open the command palette with CTRL + SHIFT + P , then start typing "reload".使用CTRL + SHIFT + P打开命令面板,然后开始输入“重新加载”。 The option you want is called "Developer: Reload Window"您想要的选项称为“开发人员:重新加载窗口”

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM