Python环境的自动寻源/启用是一个很好的特性!但我不知道如何为任务禁用它。例如,Pyenv在其virtualenv中自动激活并运行命令,因此我的pipenv run命令最终会出错。 我对这种行为做了一点小小的调整。你知道吗
作为参考,这是我的.vscode/任务.json文件
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [{
"label": "Run IPython Shell",
"problemMatcher": [],
"type": "shell",
"command": "pipenv run ipython",
"presentation": {
"echo": true,
"reveal": "always",
"focus": true,
"panel": "shared",
"showReuseMessage": true,
"clear": false
}
}]
}
输出如下:
> Executing task: pipenv run ipython <
source /Users/nahuel/.virtualenvs/pysrv-RjlHvHY5/bin/activate
Python 3.6.6 (default, Aug 6 2018, 12:14:58)
Type 'copyright', 'credits' or 'license' for more information
IPython 7.1.1 -- An enhanced Interactive Python. Type '?' for help.
In [1]: source /Users/nahuel/.virtualenvs/pysrv-RjlHvHY5/bin/activate
File "<ipython-input-1-944ce73c2717>", line 1
source /Users/nahuel/.virtualenvs/pysrv-RjlHvHY5/bin/activate
^
SyntaxError: invalid syntax
In [2]:
这在当前版本的VSCode中不是问题。环境激活适用于pipenv和poetry,可以通过设置进行自定义。你知道吗
相关问题 更多 >
编程相关推荐