Home > Development Tools > VSCode > body text

How to use virtual environment with vscode

Release: 2020-03-17 13:50:58
Original
5297 people have browsed it

How to use virtual environment with vscode

要在VScode中使用Python的virtualenv虚拟环境,首先在设置同添加虚拟环境所在目录和虚拟环境的识别规则:

{
  ...
  "python.venvPath": "E:\\envs",
  "python.venvFolders": [
    "envs",
    ".pyenv",
    ".direnv',
    ".env"
  ]}
Copy after login

虚拟环境是通过名称识别的,例如在E:\envs目录下django_env, flash_env就不被".env"识别到.
重启下VScode设置才生效。

之后当你想要切换虚拟环境的时候只需要通过命令面板Python: Select Interpreter就会列出所有的虚拟环境。

How to use virtual environment with vscode

推荐学习:vscode教程

The above is the detailed content of How to use virtual environment with vscode. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template