Conda环境正常,sublime中直接添加报错解决方案

conda环境在anaconda prompt中正常使用,sublime中通过tools->build system->new build system的方式将conda环境添加进去时,使用的时候会报一大堆错。

原因:使用前需要先激活环境

解决方案:

Step 1. Follow these instructions. https://docs.anaconda.com/anaconda/user-guide/tasks/integration/sublime/
Step 2. Press Ctrl+Shift+P and select Conda:Activate Environment.
Step 3. Import numpy and cry from happiness.

注意:

默认的conda目录可能与自己的目录不同,此时需要进行修改:

  1. 菜单栏选择 Tools -> Build System -> Conda
  2. 菜单栏依次选择Preferences -> Package Settings -> Conda -> Setting-User ,输入如下配置:
  3. // 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": "E:/Anaconda3/python",
    
    // Directory in which the conda envs are stored
    // Default location is the user's home directory
    //"environment_directory": "~/anaconda3/envs/",
    "environment_directory": "E:/Anaconda3/envs/",
    
    // configuration is the path to conda's configuration file
    "configuration": "~/.condarc"
    }
    

    其中"executable" 和"environment_directory"按自己实际anaconda3安装路径配置

修改完成后执行第二步就可以了!

下次需要使用conda环境时,

先把Tools->Build System改为Conda

Ctrl+Shift+P->Conda 点击Activate Environment,选择需要的环境即可。

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值