vscode conda configure python environment (windows)

conda: Used for python installation package management, can automatically match the installation package of the current python version. After changing to the Tsinghua path, the download speed is very fast.

    At the same time, multiple environments can be created.

    Conda installation is recommended not to save it to environment variables, but in this case, it is difficult to use the conda command in the cmd window. Can just conda

    The scripts path is saved to an environment variable, then the conda command is available in the cmd window.

    The conda program is very large. If you don't need much environment, you can install miniconda.

vscode configuration:

seting.json, configure python path

{
    "python.pythonPath": "X:\\MiniConda\\python"
}

  X position is conda installation drive letter

If you want to run the program every time without typing commands in the terminal, write task.json

{
    // See https://go.microsoft.com/fwlink/?LinkId=733558
    // for the documentation about the tasks.json format
    "version": "2.0.0",
    "tasks": [
        {
            "label": "Test",
            "type": "shell",
            "command": "X:\\MiniConda\\python",
            "args": [
                "${file}"
            ],
            "presentation": {
                "reveal": "always",
                "panel": "shared"
            },
            "group": {
                "kind": "build",
                "isDefault": true
            }
        }
    ]
}

  label: project name

 

Remarks:

  There are some problems with the compatibility of the powersell terminal of conda and vscode, you can change the default terminal to cmd

  There will be many commands when the terminal is used for a period of time, the display is very confusing, you can customize the shortcut keys to clean the terminal.

Guess you like

Origin www.cnblogs.com/liudianfengmang/p/12732203.html