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

Summary of the differences between get and post requests in Vue

The operating environment of this tutorial: Windo...

Process analysis of deploying ASP.NET Core applications on Linux system Docker

Table of contents 1. System environment 2. Operat...

Commonly used English fonts for web page creation

Arial Arial is a sans-serif TrueType font distribu...

WeChat applet realizes chat room function

This article shares the specific code of WeChat a...

How to install docker and portainer in kali

With the emergence of docker, many services have ...

Vue.js Textbox with Dropdown component

A Textbox with Dropdown allows users to select an...

An example of vertical centering of sub-elements in div using Flex layout

1. Flex is the abbreviation of Flexible Box, whic...

Detailed explanation of Linx awk introductory tutorial

Awk is an application for processing text files, ...

Several mistakes that JavaScript beginners often make

Table of contents Preface Confusing undefined and...

UTF-8 and GB2312 web encoding

Recently, many students have asked me about web p...

Vue implements the frame rate playback of the carousel

This article example shares the specific code of ...

Vue.js manages the encapsulation of background table components

Table of contents Problem Analysis Why encapsulat...

How to implement Ajax concurrent request control based on JS

Table of contents Preface Ajax serial and paralle...