mdivk
mdivk

Reputation: 3727

Not able to activate new environment with conda

Despite the fact that there are lots of discussions on this topic, I am not able to find a true solution to activate any new environments created using either regular methods, or yml with conda.

I am using Anaconda 4.4.10

I created an environment as below, using the following two methods mentioned in the official document

conda create --name myenv

and

conda env create -f environment.yml

Now I have two new env: py36 and rxie-env:

$ conda env list
py36 /home/hadoopuser/.conda/envs/py36
rxie-env /home/hadoopuser/.conda/envs/rxie-env
base * /opt/cloudera/parcels/Anaconda

with conda activate I got the following error:

CommandNotFoundError: Your shell has not been properly configured to use 'conda activate'. If your shell is Bash or a Bourne variant, enable conda for the current user with

$ echo ". /opt/cloudera/parcels/Anaconda/etc/profile.d/conda.sh" >> ~/.bashrc

or, for all users, enable conda with

$ sudo ln -s /opt/cloudera/parcels/Anaconda/etc/profile.d/conda.sh /etc/profile.d/conda.sh

The options above will permanently enable the 'conda' command, but they do NOT put conda's base (root) environment on PATH. To do so, run

$ conda activate in your terminal, or to put the base environment on PATH permanently, run

$ echo "conda activate" >> ~/.bashrc

Previous to conda 4.4, the recommended way to activate conda was to modify PATH in your ~/.bashrc file. You should manually remove the line that looks like ........... export PATH="/opt/cloudera/parcels/Anaconda/bin:$PATH"

^^^ The above line should NO LONGER be in your ~/.bashrc file! ^^^

However, by following the given instruction I did the following:

  1. echo "conda activate" >> ~/.bashrc

  2. source ~/.bashrc (not mentioned in the prompt but I think it is needed)

  3. remove export PATH="/opt/cloudera/parcels/Anaconda/bin:$PATH"

    Now I have another new error below:

-bash: /home/jhelmus/workspace/misc/cdh_parcel/anaconda/scripts/parcel/tmp/Anaconda-5.1.0/bin/conda: No such file or directory

As you can see the error points to the conda developer jhelmus's home directory.

jhelmus: https://anaconda.org/jjhelmus

Who can tell me what is the right secret command to get the new env activated?

Thank you very much.

Upvotes: 2

Views: 2714

Answers (1)

mdivk
mdivk

Reputation: 3727

so the answer is this version of Anaconda has bug, upgrade to higher version resolved this issue.

Upvotes: 3

Related Questions