下載conda插件
Preference-->Package Control-->install package--> Conda(單擊)
更改build system
Tools-->build system-->Conda
配置環(huán)境
把默認的Python環(huán)境改成已創(chuàng)建的虛擬環(huán)境的python
Preferences-->Package Settings-->Conda-->Settings
會出現(xiàn)兩個窗口帆调,在右側(cè)的窗口寫下下面的代碼:
/ 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虛擬環(huán)境中的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虛擬環(huán)境中的路徑
// configuration is the path to conda's configuration file
"configuration": "~/.condarc"
}
激活環(huán)境
調(diào)出command palette: Ctrl+Shift + P
輸入Conda暖呕,選擇下拉列表中Activate Environment峻汉,再選中自己之前創(chuàng)建的環(huán)境就好啦
目前來看已經(jīng)成為默認設(shè)置明吩,不用每次打開進行激活
缺點就是結(jié)果顯示在下方命令行中蓝晒,運行需要用Ctrl+B镇饺,停止需要Tools-->Cancel build说订,不過是可以接受的灵临。
https://blog.csdn.net/zplai/article/details/106070601 這個是我目前實踐下來切實可用的