Skip to content

duttaprat/AnacondaInstallation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 

Repository files navigation

A Step to Step Guide to Install Anaconda in Ubuntu

In this repository, I am going to guide the following things

How to download and install Anaconda

Downlod Anaconda Installer

You can download the Anaconda installer either using Terminal or manually from the website. Follow the steps to download it from Anaconda Distribution Page.

  1. Go to the Anaconda Distribution Page and click Download.

    2020-09-17

  2. After clicking you will redirect to the page section where you can find various Anaconda Installer. Now you can download the Anaconda Installer using two approaches.

    • Mannual download: Download specific installer by clicking the appropiate version based on your OS. 2020-09-17 (1)
    • Using Terminal: Right click on the link of your specific version of the installer and copy the link. Then use terminal to download the installer 2021-11-04 (2)
      $ wget <link copied>
      
  3. Anaconda3-2020.07-Linux-x86_64 will download.

Installation

After downloading the installer(Anaconda3-2020.07-Linux-x86_64), please make sure where it is located. I put the installer in Downloads folder. To install, do following steps

  1. Open your Terminal and go to the specific folder(in my case, the folder Downloads). Then use the following command

    pratik@PRATIK-YOGA:~$ cd Downloads/    
    pratik@PRATIK-YOGA:~/Downloads$ bash Anaconda3-2020.07-Linux-x86_64
  2. You will see the following output

    2020-09-17 (3)

  3. Click ENTER and finally it prompts yes or no. Enter yes. It will take a few minutes to install the anaconda in your system.

  4. The installer prompts Do you wish the installer to initialize Anaconda3 by running conda init? Enter “yes”.

  5. To check if Anaconda install properly, close your terminal and then reopen it. Then type

      pratik@PRATIK-YOGA:~$ conda list    

    It will show a list of packages install through Anaconda.

  • If after reopening the terminal you are not getting the conda list, follow the instructions
    • Open .bashrc file using vi ~/.bashrc
    • Add the line export PATH="/home/username/anaconda3/bin:$PATH" in the file
    • Then execute the command source ~/.bashrc

How to create conda environment and run your code

The next step is to create conda environments. To know about the details of the conda environments, you can refer to its official documentation page. Few basic steps for using the conda environment are follows

Create conda environment

Conda environment nothing but a virtual environment. You can customize the environment as per your requirements.

  1. Suppose, you want to create a conda environment named first_env. Use the following command
pratik@PRATIK-YOGA:~$ conda create --name first_env
  1. Most in the cases, we need specific version of Python. Suppose, you need to install Python=3.7 and the name of the environment is second_env, use the following command
    pratik@PRATIK-YOGA:~$ conda create --n second_env python=3.7
    ** Note, your python version of the conda environment and your local machine can be different.

Activating conda environment and run your code

  1. You can have multiple conda environments. To see all the conda environments, use the following command

    pratik@PRATIK-YOGA:~$ conda info --envs

    Output will be

    # conda environments:
    #
    base                  */home/pratik/anaconda3 
    first_env              /home/pratik/anaconda3/envs/first_env
    second_env             /home/pratik/anaconda3/envs/second_env
  2. To use any specific conda environment, you need to activate it. Suppose, you need to activate second_env environment

    pratik@PRATIK-YOGA:~$ conda activate second_env

    Now, second_env environment is activated. You can understand from your terminal only. pratik@PRATIK-YOGA:~$ will change to (second_env)pratik@PRATIK-YOGA:~$

  3. Now you can run your code in this terminal. For your project, if you need to install any package, you can do that following way

  • Install specific package: Suppose you need to install tensorflow package in your conda environment
  (second_env)pratik@PRATIK-YOGA:~$ conda install -c conda-forge tensorflow
  • Install specific package with specific version: Suppose you need to install tensorflow 1.14 version package in your conda environment
  (second_env)pratik@PRATIK-YOGA:~$ conda install -c conda-forge tensorflow=1.14

About

A Step to Step Guide to Install Anaconda in Ubuntu

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published