Advance

Tutorial Setup Anaconda On Ubuntu 22.04

Tutorial setup Anaconda On Ubuntu 22.04
1
(1)

People are beginning to understand the need for analytics in petabyte data that is produced with great potential and find it useful to move into the world of tomorrow. This indicator requires the production of several scientific data packages that can do this process by making more data analysis.  Although many data science packages have been developed, many users prefer one of the best data science packages named Anaconda. In this article, we are going to teach you How to Setup Anaconda on Ubuntu 22.04. You can also check out the packages offered on the Eldernode website if you would like to purchase an Ubuntu VPS server.

What is Anaconda?

Anaconda is a free and open-source distribution of Python and R programming languages used to perform scientific computations and process large amounts of data. Anaconda aims to simplify package management and deployment. The Anaconda distribution is used by more than 15 million users and includes more than 1500 popular science datasets suitable for Windows, Linux, and macOS.

Anaconda is a complete science package launched on July 17, 2012, as an attempt to create a complete set of packages used for Data Science. This package is very easy to download and install and is highly supported on Linux, Windows, and macOS. In addition to Python and R, Anaconda also includes Scala programming languages.

Anaconda Features

-> Ability to download more than 1500 Python/R Data Science packages

-> Manage libraries, dependencies and environments

-> Development and training of machine learning and deep learning models with sci-kit-Learn, TensorFlow and Theano

-> Scalable and performance data analysis with Dask NumPy, Pandas and Numba

-> Visualize results with Matplotlib, Bokeh, Datashader and Holoviews

How to Setup Anaconda on Ubuntu 22.04

Anaconda is not available in the default Ubuntu 22.04 system repository, and you need to download the Anaconda installation script manually.

First, go to the official Anaconda download page and select the Linux icon under the Download section.

 

Download-Anaconda-installer - Setup Anaconda On Ubuntu 22.04

 

Now you will navigate to the following page. Select the 64-bit version of Linux. Wait for the download to finish.

 

Select-Anaconda-version

 

After the download is complete, open the terminal and go to the Downloads directory. You can go to the Downloads directory by entering the following command:

cd Downloads

Since everything downloaded with the browser goes to the Downloads menu by default, check if the downloaded script file is in the folder. To do this, run the following command:

ls

After making sure the file exists, run the following command:

sh file-name

Note: Remember to put your file name in the command instead of file-name.

After the installation wizard starts, you should press the Enter key to start the configuration process. Write Yes to agree to the terms and conditions and press q to skip the “End User License Agreement“.

Now you need to set the installation folder location. The installation directory will be created under your current user. To assign and define some custom location, press Enter.

 

Anaconda-installation-folder

 

Next, you need to initialize the Conda init. To do this, type Yes and press Enter.

To access the Anaconda command tool, you can add the extracted Anaconda folder path to your system path by running the following command:

echo "export PATH=$PATH:/home/eldernode/anaconda/bin">> ~/.bashrc

If you want to use Anaconda without restarting and logging out of the session, you should reload your profile with the following command:

source ~/.bashrc

How to Use Anaconda on Ubuntu 22.04

You can setup a new Anaconda environment for your project by entering the following command:

conda create

If you want to install any package in Anaconda Environment, run the following command:

conda install -n firstenv package-name

Note: Remember to put your package name instead of package-name.

You can activate the environment with the following command:

conda activate firstenv

And to deactivate it use the following command:

conda deactivate

You can use the following command to deactivate the Conda based environment to prevent starting automatically when startup in your Ubuntu command terminal:

conda config --set auto_activate_base false

If you want to use the Anaconda Navigator which is Anaconda’s graphical user interface to manage your project, just enter the following command:

anaconda-navigator

 

anaconda-python-navigator

 

You can update the Anaconda with the following command:

conda update --all

If you want to remove the Anaconda installation directory and all other files from your system, use the following command:

rm -rf ~/anaconda3 ~/.condarc ~/.conda ~/.continuum

Then you should open the ~/.bashrc file and remove the Anaconda directory from the path environment variable:

# >>> conda initialize >>>  # !! Contents within this block are managed by 'conda init' !!  __conda_setup="$('/home/eldernode/anaconda3/bin/conda' 'shell.bash' 'hook' 2> /dev/null)"  if [ $? -eq 0 ]; then  eval "$__conda_setup"  else  if [ -f "/home/eldernode/anaconda3/etc/profile.d/conda.sh" ]; then  . "/home/eldernode/anaconda3/etc/profile.d/conda.sh"  else  export PATH="/home/eldernode/anaconda3/bin:$PATH"  fi  fi  unset __conda_setup  # <<< conda initialize <<<

How to Create Desktop and Launcher shortcut

You need to create a desktop shortcut to launch Anaconda Navigator. You can do this manually to run it without need to access Terminal.

First, open the Terminal on your Ubuntu 22.04 LTS.

Now you should go to the Desktop directory by entering the following command:

cd Desktop

Then create a file for the Anaconda Desktop shortcut using your favorite text editor:

nano anaconda.desktop

After you see a configuration file, you should copy-paste the following text:

[Desktop Entry]  Version=1.0  Type=Application  Name=Anaconda  Exec=/home/eldernode/anaconda/bin/anaconda-navigator  Icon=/home/eldernode/anaconda/lib/python3.9/site-packages/anaconda_navigator/app/icons/Icon1024.png  Terminal=false

Remember to put your username instead of “eldernode” and your system’s python version instead of 3.9.

To save the file, just press Ctrl+X, type y and press Enter.

Also, you need to copy the same for the launcher:

sudo cp ~/Desktop/anaconda.desktop /usr/share/applications/

 

Allow-Launching-Desktop-shortcut - Setup Anaconda On Ubuntu 22.04

*

Anaconda-Desktop-Shortcut - Tutorial Setup Anaconda On Ubuntu 22.04

That’s it!

Conclusion

Anaconda includes the conda command-line tool and Anaconda Navigator which is a desktop graphical user interface. I hope this tutorial was useful for you. In this article, we taught you how to setup Anaconda on Ubuntu 22.04. If you have any questions, you can contact us from Comments.

How useful was this post?

Click on a star to rate it!

Average rating 1 / 5. Vote count: 1

No votes so far! Be the first to rate this post.

View More Posts
Marilyn Bisson
Content Writer
Eldernode Writer
We Are Waiting for your valuable comments and you can be sure that it will be answered in the shortest possible time.

Leave a Reply

Your email address will not be published. Required fields are marked *

We are by your side every step of the way

Think about developing your online business; We will protect it compassionately

We are by your side every step of the way

+8595670151

7 days a week, 24 hours a day