powershell - conda 在 powershell 上激活
问题描述
全新安装 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 的输出,我能够确定我的路径中缺少什么。
推荐阅读
- c++ - 没有相应弹出的 pragma pack(push) 导致堆栈粉碎
- python - 如何在 Python 字符串中包含转义字符
- mysql - MySQL - 不显示来自 ID 使用的任何行
- scala - 在 rdd 中使用 scala 过滤器功能时的问题
- amazon-web-services - AWS CloudFormation 密钥不接受特殊字符
- html - 为什么 HTML5 中的一些新元素仍然应用了演示文稿?
- android - Kotlin 编写了一个函数来检查潜在的几十个值并返回它们的非空值与 lambda 类型
- bash - 解压 .tar.gz 并修改结果文件
- amazon-web-services - 有没有办法就哪个 VPC 是默认 VPC 向 CloudFormation 撒谎?
- javascript - Ngx-graph 没有正确显示节点和边