Installing Anaconda on Linux
Download Anaconda
From Anaconda site
- Download Anaconda installer for Linux from here: https://www.anaconda.com/download/
- Choose
Python 2.7
orPython 3.6
, read python2 vs python3
From Anaconda repository
- Download Anaconda installer for Linux from here: https://repo.continuum.io/archive/ using
wget
or from the browser. - If you choose to use
wget
, check the latest versionX.X.X
, open up a terminal and replace the X.X.X with the latest version. - For Python 2.7 :
wget http://repo.continuum.io/archive/Anaconda2-X.X.X-Linux-x86_64.sh
- for Python 3.x:
wget http://repo.continuum.io/archive/Anaconda3-5.0.1-Linux-x86_64.sh
Installing Anaconda
- Open up a terminal.
-
cd
to your installer folder. - Type
sh ./AnacondaXXXXXXXX.sh
, whereAnacondaXXXXXXXX.sh
refers to the downloaded file name. - Follow the instructions on the screen. Accept the defaults if you are not sure what to do .
- Installation will be finished within 5 minutes.
- The following line will be appeared:
Do you wish the installer to prepend the AnacondaX install location to PATH in your /home/XXX/.bashrc ? [yes|no]
- If you use
bash
, you can typeyes
for easy installation. Read the next session aboutPATH variable
- Everything is done. Refresh your bash terminal by
source ~/.bashrc
Anaconda PATH
variable
The Anaconda will NOT append the PATH
variable during Linux installation. To qurantee your installation is successful, you need to check your rcfile for Bash, i.e. the .bashrc
stored under the Home directory of Linux. To read the .bashrc
:
- Type
cat ~/.bashrc
in your terminal. - If you have the following lines at the end, it means the installation is OK.
# added by Anaconda2 installer export PATH="/home/XXXXX/anacondaX/bin:$PATH"
- If you doesn’t got this line, first check the Anaconda installation location (usually /home/XXXXX/anacondaX/) and add the following line (Replace /home/XXXXX/anacondaX/ with your installation location) to
~/.bashrc
using a text editor:export PATH="/home/XXXXX/anacondaX/bin:$PATH"
- If you have no idea what is a text editor, open a terminal,
type
echo "export PATH="/home/XXXXX/anacondaX/bin:$PATH"" >> ~/.bashrc
and enter, of course you need to replace your installation folder here.
Successful Anaconda installation
- Run
source ~/.bashrc
in the terminal. - Type
python
in the terminal. - Similar strings will be appeared:
Python 2.7.14 |Anaconda custom (64-bit)| (default, Oct 16 2017, 17:29:19) [GCC 7.2.0] on linux2 Type "help", "copyright", "credits" or "license" for more information.
- If the following similar strings appeared, redo the previous session or run
source ~/.bashrc
in the terminal.Python 2.7.14 (default, Jan 5 2018, 10:41:29) [GCC 7.2.1 20171224] on linux2 Type "help", "copyright", "credits" or "license" for more information.
Updating conda
- Open a terminal.
- Run
conda update anaconda
.
Uninstalling conda
- Open a terminal.
- Check the Anaconda installation path.
- Usually
~/anacondaX/
- Run
rm -fr ~/anacondaX/
- Open your
~/.bashrc
- Find and remove the line
export PATH="/home/XXXXX/anacondaX/bin:$PATH"
- Run
source ~/.bashrc