Detailed steps to install Anaconda on Linux (Ubuntu 18.04)

Detailed steps to install Anaconda on Linux (Ubuntu 18.04)

Anaconda is the most popular python data science and machine learning platform for large-scale data processing, predictive analytics, and scientific computing. The Anaconda distribution comes with more than 1,000 data packages, the conda command-line tool, and the Anaconda Navigator desktop graphical user interface.

This tutorial will guide you through downloading and installing the Anaconda Python Distribution on Ubuntu 18.04.

Download Anaconda

At the time of writing this article, the latest stable version of Anaconda is version 5.3.

Please select 64-Bit (x86) Installer for download link: https://pan.baidu.com/s/1rNA9D8gaGHuIE0Ao_l5AQA Extraction code: uecd. Try not to use python2.7, as many libraries no longer support python2.7.

Click the link to download and an information collection box will pop up. Just close it.

Install Anaconda

$ sudo sh Anaconda3-5.3.0-Linux-x86_64.sh 
[sudo] Password for andrew: 
Welcome to Anaconda3 5.3.0
In order to continue the installation process, please review the license
agreement.
Please, press ENTER to continue
>>> # Press Enter... # Press the spacebar multiple times to finish reading the license.
Do you accept the license terms? [yes|no]
[no] >>> yes # Enter yes
 - Press ENTER to confirm the location
 - Press CTRL-C to abort the installation
 - Or specify a different location below
...
[/home/andrew/anaconda3] >>> /usr/local/anaconda3 # Enter custom directory... # The installation usually takes several minutes, depending on the performance of the machine.
# Discussion DingTalk group 21745728 QQ group 144081101 567351477
# This article address: https://www.jianshu.com/p/9fe9ff999234
Do you wish to proceed with the installation of Microsoft VSCode? [yes|no] #Select no. Generally speaking, the built-in spyder and professional IDE wingIDE are better to use.
...
Do you wish the installer to initialize Anaconda3
in your /home/andrew/.bashrc ? [yes|no]
[no] >>> # Select yes
Initializing Anaconda3 in /home/andrew/.bashrc
A backup will be made to: /home/andrew/.bashrc-anaconda3.bak
For this change to become active, you have to open a new terminal.
Thank you for installing Anaconda3!
===========================================================================
Anaconda is partnered with Microsoft! Microsoft VSCode is a streamlined
code editor with support for development operations like debugging, task
running and version control.
To install Visual Studio Code, you will need:
 -Administrator Privileges
 - Internet connectivity
Visual Studio Code License: https://code.visualstudio.com/license
Do you wish to proceed with the installation of Microsoft VSCode? [yes|no]
>>> no

Add “export PATH=/usr/local/anconda3/bin:$PATH“ to /etc/profile so that all users can use Anaconda python3.7.

The above .bashrc has the following content added during installation:

# added by Anaconda3 5.3.0 installer
# >>> conda init >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$(CONDA_REPORT_ERRORS=false '/usr/local/anaconda3/bin/conda' shell.bash hook 2> /dev/null)"
if [ $? -eq 0 ]; then
 \eval "$__conda_setup"
else
 if [ -f "/usr/local/anaconda3/etc/profile.d/conda.sh" ]; then
 . "/usr/local/anaconda3/etc/profile.d/conda.sh"
 CONDA_CHANGEPS1=false conda activate base
 else
 \export PATH="/usr/local/anaconda3/bin:$PATH"
 fi
fi
unset __conda_setup ~/.bashrc
# <<< conda init <<<

Verify Installation

Load the environment variables by re-login or executing 'source ~/.bashrc".

$ conda info
 active environment : base
 active env location : /usr/local/anaconda3
  shell level : 1
 user config file : /home/andrew/.condarc
 populated config files: 
  conda version : 4.5.11
 conda-build version : 3.15.1
  Python version: 3.7.0.final.0
 base environment : /usr/local/anaconda3 (read only)
  channel URLs : https://repo.anaconda.com/pkgs/main/linux-64
    https://repo.anaconda.com/pkgs/main/noarch
    https://repo.anaconda.com/pkgs/free/linux-64
    https://repo.anaconda.com/pkgs/free/noarch
    https://repo.anaconda.com/pkgs/r/linux-64
    https://repo.anaconda.com/pkgs/r/noarch
    https://repo.anaconda.com/pkgs/pro/linux-64
    https://repo.anaconda.com/pkgs/pro/noarch
  package cache : /usr/local/anaconda3/pkgs
    /home/andrew/.conda/pkgs
 envs directories : /home/andrew/.conda/envs
    /usr/local/anaconda3/envs
  platform : linux-64
  user-agent : conda/4.5.11 requests/2.19.1 CPython/3.7.0 Linux/4.15.0-36-generic ubuntu/18.04 glibc/2.27
  UID:GID : 1000:1000
  netrc file : None
  offline mode : False
$ python
Python 3.7.0 (default, Jun 28 2018, 13:15:42) 
[GCC 7.2.0] :: Anaconda, Inc. on Linux
Type "help", "copyright", "credits" or "license" for more information.
>>>

At this point, the installation is complete.

Update Anaconda

It is usually only needed when a new version is released.

$ conda update conda
$ conda update anaconda

Removing Anaconda

It is usually only needed when a new version is released.

$ sudo rm -rf /usr/local/anaconda3
Delete the above ~/.bashrc and /etc/profile modifications and clear the hidden files: rm -rf ~/.condarc ~/.conda ~/.continuum

Summarize

This is the end of this article about the detailed steps to install Anaconda on Linux (Ubuntu 18.04). For more information about installing Anaconda on Linux, please search 123WORDPRESS.COM's previous articles or continue to browse the following related articles. I hope everyone will support 123WORDPRESS.COM in the future!

You may also be interested in:
  • A brief analysis of the problem of installing conda on linux

<<:  JavaScript to filter arrays

>>:  How to write DROP TABLE in different databases

Recommend

MySQL 8.0.11 MSI version installation and configuration graphic tutorial

This article shares the installation and configur...

How to add Vite support to old Vue projects

1. Introduction I have taken over a project of th...

Docker commands are implemented so that ordinary users can execute them

After installing docker, there will usually be a ...

Nodejs combined with Socket.IO to realize websocket instant communication

Table of contents Why use websocket Socket.io Ope...

A brief analysis of the use of zero copy technology in Linux

This article discusses several major zero-copy te...

How to solve the problem of blurry small icons on mobile devices

Preface Previously, I talked about the problem of...

Share 16 burning flame effect English fonts treasure trove

We live in a visual world and are surrounded by m...

Simple operation of installing vi command in docker container

When using a docker container, sometimes vim is n...

UDP DUP timeout UPD port status detection code example

I have written an example before, a simple UDP se...

Use of MySQL query rewrite plugin

Query Rewrite Plugin As of MySQL 5.7.6, MySQL Ser...

Tutorial diagram of installing TomCat in Windows 10

Install TomCat on Windows This article will intro...