简体   繁体   English

Visual Studio Code 未激活为 jupyter 笔记本选择的 python 解释器

[英]Visual Studio Code not activating the selected python interpreter for jupyter notebook

My conda environments all show up in the select interpreter path.我的 conda 环境都显示在 select 解释器路径中。 When I select the conda environment ( Python 3.7.7 64-bit ('adv_ml':conda) ) I want and navigate to an existing jupyter notebook in vscode.当我 select conda 环境 ( Python 3.7.7 64-bit ('adv_ml':conda) ) 时,我想要并导航到 vscode 中现有的 jupyter notebook。 I noticed that a different conda env (conda env B) is active despite both the kernel and python interpreter saying Python 3.7.7 64-bit ('adv_ml':conda) is selected.我注意到尽管 kernel 和 python 解释器都说Python 3.7.7 64-bit ('adv_ml':conda)被选中,但不同的 conda env (conda env B) 处于活动状态。

Additionally, the.vscode settings.json in my project has the correct conda env此外,我项目中的 .vscode settings.json 具有正确的 conda env

{
    "python.pythonPath": "/Users/me/anaconda3/envs/adv_ml/bin/python",
    "jupyter.jupyterServerType": "local"
}

Now here is the kicker... if I create a new jupyter notebook, when I check what conda env it is using it is using the correct conda environment Python 3.7.7 64-bit ('adv_ml':conda) .现在这是关键……如果我创建一个新的 jupyter notebook,当我检查它使用的是什么 conda env 时,它使用的是正确的 conda 环境Python 3.7.7 64-bit ('adv_ml':conda)

Is there a setting I am missing that is causing existing jupyter notebooks in my vscode to be tied to this other environment?是否有我缺少的设置导致我的 vscode 中现有的 jupyter notebooks 绑定到其他环境? Additionally, I didn't create these other notebooks so it's not like they have this incorrect environment to begin with.此外,我没有创建这些其他笔记本,所以它们并不是一开始就有这个不正确的环境。 I should be able to edit existing notebooks with the selected environment.我应该能够使用所选环境编辑现有笔记本。

Actually, if you open an existed.ipynb file, the environment should be the one last time used, so it's not a question or setting missed.其实如果打开existed.ipynb文件,环境应该是上次使用的,所以不是问题,也不是设置遗漏。

You can manually select the environment you wanted by clicking the envrionment option:您可以通过单击环境选项手动 select 您想要的环境: 在此处输入图像描述

conda info:康达信息: 在此处输入图像描述

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

相关问题 将 Python 和 Jupyter Notebook 与 Visual Studio Code 集成 - Integrating Python and Jupyter Notebook with Visual Studio Code 无法在 Visual Studio 代码中启动 jupyter notebook - Unable to start jupyter notebook in visual studio code 在 Visual Studio Code 中,jupyter notebook 和 notebook 有什么区别? - Within Visual Studio Code, what is the difference between a jupyter notebook and a notebook? visual studio 代码中用于 jupyter notebook 的“笔记本新控制台” - "New Console for notebook" for jupyter notebook in visual studio code 如何让 Visual Studio Code 中的 Code Runner 扩展使用选定的 Python 解释器? - How do you get the Code Runner extension in Visual Studio Code to use the selected Python interpreter? 如何将 python 解释器添加到 Visual Studio Code? - How to add python interpreter to Visual Studio Code? Visual Studio Code 和 Python 解释器的问题 - Issue with Visual Studio Code and the Python Interpreter Visual Studio 代码卡在 Select Python 解释器上 - Visual studio code is stuck on Select Python Interpreter 在 Visual Studio Code 中未检测到 Python 解释器 - Python Interpreter not detected in Visual Studio Code 使用 jupyter notebook 时,Visual Studio Code 不断崩溃 - Visual Studio Code crashes constantly when working with jupyter notebook
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM