在崇高的文字3中使用conda环境 [英] use conda environment in sublime text 3

查看:121
本文介绍了在崇高的文字3中使用conda环境的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用Sublime Text 3,如何使用在 http://conda.pydata.org/docs/using/envs.html

Using Sublime Text 3, how can I build a python file using a conda environment that I've created as in http://conda.pydata.org/docs/using/envs.html

推荐答案

标准Python .sublime-build 文件如下所示:

A standard Python .sublime-build file looks like this:

{
    "cmd": ["/path/to/python", "-u", "$file"],
    "file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
    "selector": "source.python"
}

要使用特定的conda环境,需要做的就是修改环境中pythonpython3可执行文件的路径.要找到它,请激活您的环境并键入(取决于您使用的版本)

All you need to do to use a particular conda environment is modify the path to the python or python3 executable within the environment. To find it, activate your environment and type (depending on the version you're using)

which python

which python3

在Linux/macOS上,或

on Linux/macOS, or

where python

在Windows上,按

,然后将路径复制到自定义的.sublime-build文件中.将文件保存在Packages/User目录中,然后确保在构建之前通过 Tools -> Build System 选择正确的文件.

on Windows, then copy the path into your custom .sublime-build file. Save the file in your Packages/User directory, then make sure you pick the right one via Tools -> Build System before building.

这篇关于在崇高的文字3中使用conda环境的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆