I am trying to remove Anaconda2 from my Ubuntu server as it is clashing with other versions of Python. As mentioned in this post, I cleared the lines ~./bashrc containing reference to anaconda2. When I try to do the same for the file ~./bash_profile, for some reason the file is already empty.

Nevertheless, when I type python -V, it displays

-bash: /home/kasa/anaconda2/bin/python: No such file or directory

I am not sure what else needs to done to erase this anaconda installation.

  • 1
    Never mind, I found the answer. I had to run the following lines $ rm -rf ~/anaconda2 $ rm -rf ~/anaconda_backup $ rm -rf ~/.condarc ~/.conda ~/.continuum – honeybadger Aug 16 '18 at 10:27
  • 2
    Welcome to Ask Ubuntu! You are encouraged to post your solution as an answer! – Melebius Aug 16 '18 at 10:30
  • 1
    That specific error message likely indicated that your shell had hashed the previous location for python - you probably could have solved it using hash -d python – steeldriver Aug 16 '18 at 11:57

Yes, indeed there were residual files on my server. I had run the following commands to completely remove any references to anaconda2.

$ rm -rf ~/anaconda2 
$ rm -rf ~/anaconda_backup 
$ rm -rf ~/.condarc ~/.conda ~/.continuum

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.