weixin_39599317
2021-01-07 13:19 阅读 19

Venv folders or Venv Path?

Environment data

  • VS Code version: 1.42.0
  • Extension version: 2020.158038
  • OS and version: macOS 10.15.2
  • Python version: 3.8.1
  • Type of virtual environment used: venv (poetry)
  • Jedi or Language Server? No, unset

Expected behaviour

Clear documentation of the difference between python.venvFolders and python.venvPath.

Actual behaviour

python.venvFolders

Folders in your home directory to look into for virtual environments (supports pyenv, direnv and virtualenvwrapper by default).

python.venvPath

Path to folder with a list of Virtual Environments (e.g. ~/.pyenv, ~/Envs, ~/.virtualenvs).

It's unclear whether both of these should be set, and what the difference is between them.

该提问来源于开源项目:microsoft/vscode-python

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享

4条回答 默认 最新

  • weixin_39622138 weixin_39622138 2021-01-07 13:19

    Sorry for the confusion here. python.venvFolders are relative paths under the users' home directory. Anything you put in there, we will always prefix with the home directory path, when searching. https://github.com/Microsoft/vscode-python/blob/2b6a8f2d439fe9d5e66665ea46d8b690ac9b2c39/src/client/interpreter/locators/services/globalVirtualEnvService.ts#L43-L44

    Where as python.venvPath is an absolute path to where the environments are created. This need not be based off of the home directory.

    Any reason these settings are separate? also, should python.venvPath be an array? Do you feel these settings need to be consolidated?

    点赞 评论 复制链接分享
  • weixin_39715907 weixin_39715907 2021-01-07 13:19

    we need to remove one of them. has some background around these two settings. https://github.com/microsoft/vscode-python/issues/1479

    点赞 评论 复制链接分享
  • weixin_39609170 weixin_39609170 2021-01-07 13:19

    yes, there's history here. Ask me offline and I can fill you in, but basically we need to eliminate one/both of them and come up with a unified solution.

    点赞 评论 复制链接分享
  • weixin_39609170 weixin_39609170 2021-01-07 13:19

    Closing as a duplicate of #1479 as that's the proper solution to this.

    点赞 评论 复制链接分享

相关推荐