A error on anaconda environment configuration

During activating environment, a error occurred as shown below on Mac terminal shell after when inputting “source ~/.bash_profile”

-bash: ./anaconda3/etc/profile.d/conda.sh: No such file or directory

Please solve this problem.

Hi @JeongHO_88127,

There is a space between dot(.) and “/anaconda3/etc/profile.d/conda.sh”:

echo ". /anaconda3/etc/profile.d/conda.sh" >> ~/.bash_profile

So, the path .bash_profile will search is “/anaconda3/etc/profile.d/conda.sh”.

To solve this, please edit your .bash_profile, the line should like this after editing:

 . /anaconda3/etc/profile.d/conda.sh

Kanika

@Kanika I ran into two issues running this code, I was able to fix the first one, but I am still getting an error when I run source, see…

First issue was that I was not able to modify ~/.bash_profile so I had to switch to root. Then I tries running Source on ~/.bash_profile and I am getting the same error as the previous user. As you can see from the picture below, the line is added to ~/.bash_profile

Any suggestions?

Regards,
Ray

Hi Ray,

Thanks for sharing the screenshots. Please make sure Anaconda is installed and also, please run below command and let me know the output:

   $ ls -l /anaconda3/etc/profile.d/conda.sh

If it is not there, please try after restarting the system. Let me know how it goes.

Kanika

@Kanika I think the issue might have to do with the fact that I changed the default directory when I installed Anaconda (months ago).

I got it to work bu fully qualifying the path in bash_profile:
. /Users/rfevrier/anaconda3/etc/profile.d/conda.sh

Now in Anaconda, I can see the mflix as an environment.

Do I have to keep this entry in my bash_profile??

Thank you!

Yes, I believe so. :slight_smile:

Kanika

last question :slight_smile:
Isn’t it the same to create the environment in Anaconda using the GUI I mean?

Where in the bash profile should i be adding this?

Hi @eliwh97,

You just need to append it at the end of the file. My .bash_profile looks like this:

Kanika

ls : cannot access '/anaconda3/etc/profile.d/conda.sh': No such file or directory
This is the error I am getting for ls command.

I can see the sh file inside /home/sree/anaconda3/etc/profile.d/conda.sh

What Can I do?

Hi @Sreekumar_85793,

Then, please use the full path for conda.sh in .bash_profile. Instead of /anaconda3/etc/profile.d/conda.sh, use: /home/sree/anaconda3/etc/profile.d/conda.sh.

Kanika

1 Like