Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
200 views
in Technique[技术] by (71.8m points)

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.

question from:https://stackoverflow.com/questions/65931126/visual-studio-code-not-activating-the-selected-python-interpreter-for-jupyter-no

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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: enter image description here


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...