sublime text配置已有的Anaconda虚拟环境

下载conda插件

Preference-->Package Control-->install package--> Conda(单击)

更改build system

Tools-->build system-->Conda

配置环境

把默认的Python环境改成已创建的虚拟环境的python
Preferences-->Package Settings-->Conda-->Settings
会出现两个窗口,在右侧的窗口写下下面的代码:

/ Default settings for sublime-text-conda:
{
// executable is the path to anaconda's python
// this python executable is used in order to find conda
//"executable": "~/anaconda3/bin/python3",
"executable": "/home/**/anaconda3/envs/***/bin/python", // conda虚拟环境中的python路径 
//自行更新一下 **: username, ***: conda environment name 

// Directory in which the conda envs are stored
// Default location is the user's home directory
//"environment_directory": "~/anaconda3/envs/",
"environment_directory": "/home/freya/anaconda3/envs/***/",// conda虚拟环境中的路径

// configuration is the path to conda's configuration file
"configuration": "~/.condarc"
}

激活环境

调出command palette: Ctrl+Shift + P
输入Conda,选择下拉列表中Activate Environment,再选中自己之前创建的环境就好啦

目前来看已经成为默认设置,不用每次打开进行激活
缺点就是结果显示在下方命令行中,运行需要用Ctrl+B,停止需要Tools-->Cancel build,不过是可以接受的。

https://blog.csdn.net/zplai/article/details/106070601 这个是我目前实践下来切实可用的

©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容