无法在 Fish-shell 中使用 conda 运行源激活 [英] Cannot run source activate with conda in Fish-shell
问题描述
我关注 conda_PR_545, conda 问题 4221 仍然无法在 Ubuntu 上运行.
I follow conda_PR_545, conda issues 4221 and still not working on Ubuntu.
从这里下载 conda.fish 后,将其 mv 到 anaconda3/bin/.
After downloading conda.fish from here, and mv it to anaconda3/bin/.
在 ~/.config/fish/config.fish 的末尾添加source/home/phejimlin/anaconda3/bin/conda.fish".
Add "source /home/phejimlin/anaconda3/bin/conda.fish" at the end of ~/.config/fish/config.fish.
conda activate spark_env
Traceback (most recent call last):
File "/home/phejimlin/anaconda3/bin/conda", line 6, in
sys.exit(conda.cli.main())
File "/home/phejimlin/anaconda3/lib/python3.6/site-packages/conda/cli/main.py", line 161, in main
raise CommandNotFoundError(argv1, message)
TypeError: init() takes 2 positional arguments but 3 were given
或
activate spark_env
Error: activate must be sourced. Run 'source activate envname'
instead of 'activate envname'.
我错过了什么吗?
推荐答案
从 fish 2.6.0 conda 4.3.27 开始:以下步骤可能会更改为 问题已解决
记下您的 conda
的位置
conda info --root
/Users/mstreeter/anaconda # this is my <PATH_TO_ROOT>
将行添加到 ~/.config/fish/config.fish
source <PATH_TO_ROOT>/etc/fish/conf.d/conda.fish
更新约定
通常你会从 bash
source activate <environment>
source deactivate <environment>
现在您必须从 fish
conda activate <environment>
conda deactivate <environment>
问题
所以在这样做之后,我无法将 fish
设置为我的默认 shell,并且它仍然可以与 conda
一起正常工作.目前,我必须先输入我的默认 shell,然后输入 fish
,然后 shell 按预期工作.在我了解如何让它完全工作后,我会更新它,而无需在每次登录我的终端时显式选择 fish
issues
so after doing this I'm not able to set fish
as my default shell and have it still work properly with conda
. Currently, I must first enter my default shell, and enter fish
and the shell works as expected. I'll update this after I find out how to get it working completely without the need to explicitly choose fish
each time I log into my terminal
这篇关于无法在 Fish-shell 中使用 conda 运行源激活的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!