1

Did a messed up Anaconda installation from inside virtualenv and then tried to clean out for an Anaconda install outside of virtualenv. Deleted Anaconda according to instructions which left me with a bad path to python:

tom@tom-ubuntu:~$ python
bash: /home/tom/anaconda/bin/python: No such file or directory

The Ubuntu 14.04 default Python installation can be reached:

tom@tom-ubuntu:~$ which python2.7
/usr/bin/python2.7

How can I reassign the python2.7 to default python?

I tried to remove (and unlink)

tom@tom-ubuntu:~$ rm /home/tom/anaconda/bin/python
rm: cannot remove ‘/home/tom/anaconda/bin/python’: No such file or directory

and setting the new link

tom@tom-ubuntu:~$ sudo ln -s /usr/bin/python2.7 /usr/bin/python
ln: failed to create symbolic link ‘/usr/bin/python’: File exists

stuck - any help appreciated.

1 Answer 1

4

Your shell caches path lookups, and the expansion from python to /home/tom/anaconda/bin/python is still cached.

Simply clear python from that cache:

hash -d python

Once cleared, bash will scan your PATH again to find /usr/bin/python.

Sign up to request clarification or add additional context in comments.

1 Comment

You can also run hash -r, which clears the entire cache (and is easier to remember).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.