「日常」Sublime text3 配置Anaconda默认虚拟环境

首先需要配置(这些之前都配过了, 不想重复):

  • Sublime text3
  • Anaconda or Minconda
  • Python2 or 3 虚拟环境
  • 代码控制台(Package Control) 及Anaconda插件等等

可自行参考Sublime3编辑器连接anaconda中的python等...有很多

默认python写入环境

其实sublime默认会调用环境中的python, 也就是anaconda装的python, 但通过以下步骤会更保险一点

  • Preferences-Package settings-Anaconda-Settings-Default
  • 更改 python_interpreter ex. "python_interpreter": "/Users/suncongrui/home/02_software/miniconda2/bin/python",
  • Preferences-Package settings-Anaconda-Settings-User
  • 添加
{
    "complete_parameters":true,
    "python_interpreter":"/Users/suncongrui/home/02_software/miniconda2/bin/python",
    "suppress_explicit_completions":true,
    "suppress_word_completion":true,
    "anaconda_linting":false
}
  • command + b即可运行

python虚拟机写入环境

  • 复制python虚拟机路径
  • Tools-Build System-New Build System
  • 写入
{
    "cmd": ["/path/to/python", "-u", "$file"],
    "file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
    "selector": "source.python"
}
  • command + b即可运行

注: 现在很多人用 jupyter notebook, 两者优缺点, 过后用过再总结吧

高效

你可能感兴趣的:(「日常」Sublime text3 配置Anaconda默认虚拟环境)