Recently, I installed Anaconda3-2.5.0-Linux-x86_64.sh on my 15.04 and ended up with this!
:~$ python --version
Python 3.5.1 :: Anaconda 2.5.0 (64-bit)
:~$ python2 --version
Python 2.7.9
:~$ python3 --version
Python 3.5.1 :: Anaconda 2.5.0 (64-bit)
During the last moments of installation, I did enter something as yes
in hurry, and I suppose it had to do something with this. (Ok, my fault, I should have handled that carefully, but I need help now, not criticism).
AFAIK this is definitely going to break other programs. What do I do now?
What I think could work.
Can this be done using aliases?
alias python=python2
But I ain't sure.
I went through the installation in a VM, and the following happend.
/home/myuser/anaconda3
.At the end you'll be asked
Python 3.5.1 :: Continuum Analytics, Inc.
creating default environment...
installation finished.
Do you wish the installer to prepend the Anaconda3 install location
to PATH in your /home/myuser/.bashrc ? [yes|no]
[no] >>> yes
Prepending PATH=/home/myuser/anaconda3/bin to PATH in /home/myuser/.bashrc
A backup will be made to: /home/myuser/.bashrc-anaconda3.bak
To restore the old behavior, go to your home directory and do
mv .bashrc-anaconda3.bak .bashrc
then start a new shell.
As you suggest, you could alias python=python2
, but I find that a bit weird. I would
.bashrc
~/bin
ln -s ~/anaconda3/bin/python3 ~/bin/python3
$HOME/bin
to $PATH
](Should already be set by default by ~/.profile
)That way, calling python3
will start the one from Anaconda.
/usr/bin/python
is still there, and still points to python2.7
. The ramifications of having python->python3
in your path depend on how a specific script is called.
If the shebang #!/usr/bin/python
is used, like it probably is in all executables that ship with Ubuntu, nothing will change. On the other hand, for better portability #!/usr/bin/env python
is sometimes used, which will now cause python3.5
to be called.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments