全新安装 conda。我正在尝试激活一个环境(任何环境),我得到以下信息
(base) PS C:\Users\AndrewBergan> conda activate test123
# >>>>>>>>>>>>>>>>>>>>>> ERROR REPORT <<<<<<<<<<<<<<<<<<<<<<
Traceback (most recent call last):
File "C:\Users\AndrewBergan\AppData\Local\Continuum\anaconda3\lib\site-packages\conda\cli\main.py", line 138, in main
return activator_main()
File "C:\Users\AndrewBergan\AppData\Local\Continuum\anaconda3\lib\site-packages\conda\activate.py", line 940, in main
print(activator.execute(), end='')
File "C:\Users\AndrewBergan\AppData\Local\Continuum\anaconda3\lib\site-packages\conda\activate.py", line 173, in execute
return getattr(self, self.command)()
File "C:\Users\AndrewBergan\AppData\Local\Continuum\anaconda3\lib\site-packages\conda\activate.py", line 150, in activate
builder_result = self.build_activate(self.env_name_or_prefix)
File "C:\Users\AndrewBergan\AppData\Local\Continuum\anaconda3\lib\site-packages\conda\activate.py", line 275, in build_activate
return self._build_activate_stack(env_name_or_prefix, False)
File "C:\Users\AndrewBergan\AppData\Local\Continuum\anaconda3\lib\site-packages\conda\activate.py", line 332, in _build_activate_stack
self._replace_prefix_in_path(old_conda_prefix, prefix))
File "C:\Users\AndrewBergan\AppData\Local\Continuum\anaconda3\lib\site-packages\conda\activate.py", line 550, in _replace_prefix_in_path
assert last_idx is not None
AssertionError
我做错了什么?
最佳答案
结果由于某种原因Continuum/anaconda3/Library/bin
没有添加到我的路径中。添加此解决了问题。
编辑: 正如下面的评论中所指出的,可能需要对您的路径进行其他修改。通过向 activate.py 添加几个打印语句并比较 conda bash 窗口和 powershell 的输出,我能够确定路径中缺少的内容。
关于powershell - conda 在 powershell 上激活,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55583926/