Michael Michael - 3 years ago 212
Linux Question

Use Default Python Rather than Anaconda Installation When Called from the Terminal

I recently installed the anaconda version of python. Now when I type

into the terminal it opens the anonconda distribution rather than the default distribution. How do I get it to use the default version for the command
in linux (ubuntu 12.04)?

Answer Source

anaconda adds the path to your .bashrc so it is found first, you can add the path to your default python to .bashrc or remove the path to anaconda if you don't want to use it.

You can also use the full path /usr/bin/python in bash to use the default python interpreter.

If you leave your .bashrc file as is, any command you run using python will use the anaconda interpreter, if you want you could also use an alias for each interpreter.

You will see something like export PATH=$HOME/anaconda/bin:$PATH in your .bashrc file.

So basically if you want to use anaconda as your main everyday interpreter use the full path to your default python or create an alias, if you want it the other way around remove the export PATH=.... from bashrc and use full path to anaconda python interpreter.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download