简体   繁体   中英

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

My conda environments all show up in the select interpreter path. 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. 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.

Additionally, the.vscode settings.json in my project has the correct 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) .

Is there a setting I am missing that is causing existing jupyter notebooks in my vscode to be tied to this other environment? 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.

You can manually select the environment you wanted by clicking the envrionment option: 在此处输入图像描述

conda info: 在此处输入图像描述

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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