use conda environment in sublime text 3(在 sublime text 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
推荐答案
注意:这将适用于使用 conda 以及 创建的虚拟环境>venv 或 virtualenv,您只需先激活它即可找到 python[3] 可执行文件的路径.
NOTE: This will work for virtual environments created with conda as well as venv or virtualenv, you just need to activate it first to find the path to the python[3] executable.
一个标准的 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 环境所需要做的就是修改环境中 python 或 python3 可执行文件的路径.要找到它,请激活您的环境并输入(取决于您使用的版本)
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 -> 选择正确的文件.在构建之前构建系统.
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.
这篇关于在 sublime text 3 中使用 conda 环境的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:在 sublime text 3 中使用 conda 环境
基础教程推荐
- 在 Celery 工作人员中捕获 Heroku SIGTERM 以优雅地关 2022-01-01
- 将 x 轴刻度更改为自定义字符串 2022-01-01
- 与常规 dict 相比,Python manager.dict() 非常慢 2022-01-01
- numpy float:比算术运算中内置的慢 10 倍? 2022-01-01
- Discord.py 缺少必需的参数 2022-01-01
- pyserial - 可以从线程 a 写入串行端口,是否阻塞从线程 b 读取? 2022-01-01
- 由Python将MP3转换为MIDI(类型错误:无法加载插件:mtg-Melodia:Melodia) 2022-01-01
- 使用生成器和迭代器时 Python 多循环失败 2022-01-01
- 用 Python 编写 Fortran 无格式文件 2022-01-01
- 尝试制作WhatsApp机器人 2022-01-01
