5

I installed Anaconda using instructions provided on the main website, which are similar to those that can be seen here: How to install Anaconda on Ubuntu?

However, I found that I had to manually change PATH using an export command in ~/.profile (as per official Ubuntu instructions: https://help.ubuntu.com/community/EnvironmentVariables) to get the system to know about ~/anaconda/bin:

export PATH="/usr/local/texlive/2014/bin/x86_64-linux:$PATH"
export PATH="~/anaconda/bin:$PATH"

Already, this was surprising because Anaconda should have been able to sort things out correctly itself during installation.

Now, another issue I am having is that when I run python in terminal, it defaults to using the Python in /usr/lib/python..., rather than ~/anaconda/bin/python.

How do I fix this?

  • Did you login again after changing the profile? – muru Mar 21 '15 at 04:33
  • @muru Yes. That was an instruction in the official instructions too. I'd like to note that commands like conda (which are in ~/anaconda/bin) work just fine in the terminal, so the export commands are fine. The issue is that /usr/lib/python command is overriding ~/anaconda/bin/python, and I don't know why. –  Mar 21 '15 at 04:38
  • did you check your bashrc isn't overriding your profile? – Chan-Ho Suh Mar 21 '15 at 04:53
  • 1
    @Chan-HoSuh How could I make sure that that isn't happening? –  Mar 21 '15 at 04:55
  • The issue may be that the tilde character doesn't get expanded when inside quotes (even double quotes) - have you tried replacing ~ by $HOME? – steeldriver Mar 21 '15 at 11:22
  • @steeldriver That fixed the issue! Can you write up something about it? –  Mar 21 '15 at 13:21

2 Answers2

8

The tilde (~) character is not expanded when enclosed in quotes (even double quotes, which allow most other filename expansions). You should replace ~ by $HOME in the PATH export:

export PATH="/usr/local/texlive/2014/bin/x86_64-linux:$PATH"
export PATH="$HOME/anaconda/bin:$PATH"
steeldriver
  • 136,215
  • 21
  • 243
  • 336
1

I faced the same issue. Tried this and it works for me

source bin/activate ~/anaconda3/

Paul
  • 11
  • 1