問題描述
目標是能夠在 Visual Studio 代碼調試器中使用我從 Conda/Anaconda 設置的環境.默認的 pythonpath 配置不會產生這種效果 - 而是轉到系統默認的 python 路徑(當你在新的 shell 中鍵入 'python' 時得到的).
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 環境?
推薦答案
在前面幾個的基礎上找到了更好的解決方案:
I found a better solution, based on the previous ones:
轉到工作場所設置.使用包含虛擬環境列表的文件夾路徑覆蓋參數 python.venvPath
.對于 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:
此設置使 VS Code 能夠識別可用的 conda 環境
.因此,我們可以點擊當前的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:
這篇關于Conda 和 Visual Studio 代碼調試的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!