我想使用虛擬環境的Visual Studio代碼。在啓動JSON我指定的nosetests推出這樣的:Visual Studio代碼和virtualenv
{
"name": "nosetests",
"type": "python",
"request": "launch",
"stopOnEntry": true,
"program": "${workspaceRoot}/env/dev/bin/nosetests",
"args": [
"--nocapture",
"tests"
],
"externalConsole": false,
"debugOptions": [
"WaitOnAbnormalExit",
"WaitOnNormalExit"
]
},
然而,當我啓動的環境變量沒有得到回升。我已經嘗試在工作區設置中設置python路徑:
"python.pythonPath": "${workspaceRoot}/env/dev/bin/python"
但它似乎沒有設置正確的環境。需要有一些「等同於源激活的東西」。有沒有人知道它?