Enable Conda env: weird error "must be received"

I am trying to run the following:

source activate env-name

But I get an error message that tells me that the call activateshould be found. In the Conda activatescript, there is an if block next to the beginning, which checks "$(basename "$0")", in particular, whether it is equal to the value activate, in which case it will raise the exception that I'm talking about. Fiddling a bit with the script (i.e. echo $0; return 1), and I found that it really believes that the 0th argument I pass is activate, and not source. This is perplexing, because I know that my team includes sourcein it and that this should be the 0th argument. I'm not sure what else needs to be done. Does anyone have any clues?

In case this is important, I use zsh as my default shell, and it seems that the activatescript is a bash script, but I don’t think it should matter (this is not the case in other places for me, only in this particular environment on my work laptop). I can get around all this by simply commenting out the entire check (and a couple of other minor changes), but I would prefer not to do this in this particular case.

+4
source share
2 answers

I had the same problem, the only workaround I found:

source <PATH TO ANACONDA>/anaconda3/bin/activate <ENV NAME>

EDIT: adding line:

export PATH=$PATH:<PATH TO ANACONDA>/anaconda3/bin:$PATH

in your bashrc (or zsh, etc.) will add the source to your path, and you can use sourceas usual.

+3
source

** , . ( , )

, . "" envname ", .

anaconda3 on/home/user/anaconda3/ correnct -/home/user/anaconda3/bin/

/home/user/anaconda3/bin/ activate tensorflow

cd /home/user/anaconda3/bin
. activate tensorflow

, ( )

0

Source: https://habr.com/ru/post/1627728/


All Articles