conda报错activate没办法激活环境

遇到激活环境报错

# >>>>>>>>>>>>>>>>>>>>>> ERROR REPORT <<<<<<<<<<<<<<<<<<<<<<

    Traceback (most recent call last):
      File "E:\software\anaconda\Lib\site-packages\conda\exception_handler.py", line 17, in __call__
        return func(*args, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^
      File "E:\software\anaconda\Lib\site-packages\conda\cli\main.py", line 91, in main_sourced
        print(activator.execute(), end="")
              ^^^^^^^^^^^^^^^^^^^
      File "E:\software\anaconda\Lib\site-packages\conda\activate.py", line 199, in execute
        return getattr(self, self.command)()
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "E:\software\anaconda\Lib\site-packages\conda\activate.py", line 165, in activate
        builder_result = self.build_activate(self.env_name_or_prefix)
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "E:\software\anaconda\Lib\site-packages\conda\activate.py", line 343, in build_activate
        return self._build_activate_stack(env_name_or_prefix, False)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "E:\software\anaconda\Lib\site-packages\conda\activate.py", line 372, in _build_activate_stack
        conda_prompt_modifier = self._prompt_modifier(prefix, conda_default_env)
                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "E:\software\anaconda\Lib\site-packages\conda\activate.py", line 736, in _prompt_modifier
        return context.env_prompt.format(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^
    KeyError: 'xxxxxxx'

需要检查和修复 .condarc 文件,打开 .condarc 文件(位于 C:\Users\xxxxx\.condarc),用文本文件打开,检查其中的配置项,特别是 envs_dirs 和 env_prompt 配置,确保 envs_dirs 中的路径是正确的。

修改完就可以正常激活环境。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值