机器学习----环境搭建VScode+Anaconda

版权声明:如需转载请联系博主! From 博主Haolin https://blog.csdn.net/ohh_haolin/article/details/85127428

anaconda:

  1. 安装:
    官网:https://www.anaconda.com/
  2. 换源:
    在CMD/SHELL中输入:
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
conda config --set show_channel_urls yes
  1. 新建环境安装关键库文件
  2. | conda install |命令可以安装东西
  3. | conda list |命令可以可以显示所有安装文件
    ,在cmd之中

Vscode:

  1. 安装:
    官网:https://code.visualstudio.com/
  2. 下载插件:
    在这里插入图片描述

3.导入配置文件:
注意python的位置和autoComplete的位置,要选择anaconda里面自己新建装好库文件的

{
    "python.pythonPath": "C:\\Users\\Haolin\\AppData\\Local\\conda\\conda\\envs\\tensorflow",
    "workbench.iconTheme": "vscode-icons",
    "terminal.integrated.shell.windows": "C:\\Windows\\System32\\cmd.exe",
    "python.linting.flake8Enabled": true,
    "python.formatting.provider": "yapf",
    "workbench.colorTheme": "Visual Studio Light",
    "python.autoComplete.addBrackets": true,
    "editor.fontSize": 17,
    "update.channel": "none",
    "python.jediEnabled": false,
    "python.autoComplete.extraPaths": [
        "C:\\ProgramData\\Anaconda3",
        "C:\\ProgramData\\Anaconda3\\Lib\\site-packages",
        "C:\\Users\\Haolin\\AppData\\Local\\conda\\conda\\envs\\tensorflow",
        "C:\\Users\\Haolin\\AppData\\Local\\conda\\conda\\envs\\tensorflow\\Lib\\site-packages",
    ],
    "path-intellisense.extensionOnImport": true,
    "path-intellisense.autoSlashAfterDirectory": true,
    "explorer.confirmDelete": false,
    "editor.mouseWheelZoom": true,
    "editor.renderWhitespace": "boundary",
    "code-runner.saveFileBeforeRun": true,
    "extensions.ignoreRecommendations": false,

}

快捷键:

// 将按键绑定放在此文件中以覆盖默认值auto[]
[
    {
        "key": "shift+f10",
        "command": "-editor.action.showContextMenu",
        "when": "textInputFocus"
    },
    {
        "key": "shift+f10",
        "command": "code-runner.run"
    },
    {
        "key": "ctrl+alt+n",
        "command": "-code-runner.run"
    }
]

特征:

  • SHIFT+ALT+F: 代码整理
  • SHIFT+F10: 代码快速运行

猜你喜欢

转载自blog.csdn.net/ohh_haolin/article/details/85127428
今日推荐