3

I imagine this is probably a duplicate, but I'm fairly new to Linux and all the other guides I've already checked seem to be referring to something different. I installed anaconda3 and accidentally told it to update the path variable. This is messing with all sorts of things for obvious reasons. When I which python I get /home/sbendl/anaconda3/bin/python,

and if I echo $PATH I get:

 /home/sbendl/anaconda3/bin:/opt/ros/kinetic/bin:/home/sbendl/bin:/home/sbendl/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin

but when I look at /etc/environment I don't see anything at all related to those. Clearly I'm confusing two different things. I would like to be able to continue using Python 3.5 when needed, but I want the default to be 2.7 so that I can use anything else that assumes 2.7.

0

3 Answers 3

0

To completely remove anaconda from your path:

  • Check for the anaconda entry in both ~/.bashrc and ~/.bash_profile and remove the line:

    export PATH="/home/sbendl/anaconda2/bin:$PATH"
    

For complete removal:

  • Remove the entries in the files stated above then get rid of the ~/anaconda2 dir.

And that should correct the issue.

1
  • I found it as a section on the bottom of bashrc. I typed: sudo nano ~/.bashrc in the terminal to remove the section
    – Jaco
    Apr 19, 2021 at 23:06
0

Anaconda is added to the PATH for all users in the /etc/profile file. This can be verified with:

$ cat /etc/profile | grep anaconda
export PATH=/opt/anaconda/bin:$PATH

To remove it simply comment out the line by preceding it with the # character. Editing this file likely needs sudo:

$ sudo pico /etc/profile

If a particular user requires Anaconda, the export command can be added to the user's .bashrc or .profile file.

0

Its 2021 now and I am running anaconda3, which is great until you don't want to author in the anaconda3 environment anymore. Even after commenting the entire anaconda3 initialization function in the ~/.bashrc, I was still having my PATH set to ~/anaconda3/bin/

I had to actually rename the anaconda3 directory to break it from setting the PATH var which apparently is now buried somewhere in ~/anaconda3/

After I did this my python path returned to /usr/bin/python where I am properly using update-alternatives to manage my various python installations. Anaconda SHOULD move to using this method on Debian/Ubuntu so that we don't have to wreck the install just to set the proper PATH.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .