問(wèn)題描述
目標(biāo)是能夠在 Visual Studio 代碼調(diào)試器中使用我從 Conda/Anaconda 設(shè)置的環(huán)境.默認(rèn)的 pythonpath 配置不會(huì)產(chǎn)生這種效果 - 而是轉(zhuǎn)到系統(tǒng)默認(rèn)的 python 路徑(當(dāng)你在新的 shell 中鍵入 'python' 時(shí)得到的).
The goal is to be able to use my environment setup from Conda/Anaconda within the visual studio code debugger. The default pythonpath configuration does not produce this effect - rather it goes to the system default python path (what you get when you type 'python' in a fresh shell).
如何配置 VS Code 以使用我的 Conda 環(huán)境?
推薦答案
在前面幾個(gè)的基礎(chǔ)上找到了更好的解決方案:
I found a better solution, based on the previous ones:
轉(zhuǎn)到工作場(chǎng)所設(shè)置.使用包含虛擬環(huán)境列表的文件夾路徑覆蓋參數(shù) python.venvPath
.對(duì)于 anaconda 的情況:
Go to Workplace Settings.
Override the parameter python.venvPath
with the Path to folder with a list of Virtual Environments. For the case of anaconda:
此設(shè)置使 VS Code 能夠識(shí)別可用的 conda 環(huán)境
.因此,我們可以點(diǎn)擊當(dāng)前的python解釋器并切換到其他的:
This setting enables VS Code to recognize the available conda environments
. Thus, we can click on the current python interpreter and switch to others:
這篇關(guān)于Conda 和 Visual Studio 代碼調(diào)試的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!