Anaconda is a popular open-source distro of Python and R programming languages that is highly praised both by beginner users and by users involved in data science as well as other scientific branches. The solution is cross-platform, so you can have it either on Linux, Windows, or Mac.
Today we want to provide you with a comprehensive guide on how to install Anaconda on your Ubuntu or Debian VPS.
Before we move on to the installation process, let’s have a brief overlook of the advantages you can enjoy in case you opt for Anaconda.
Download Anaconda or Miniconda depending on what your requirements are.
You can do this either with the Ctrl+Alt+T combination or you can find it in the applications menu.
Log in to your VPS as root through SSH. Update the system through APT.
sudo apt update
Navigate to the directory that now contains the Anaconda installation program. If it’s in the “Downloads” folder then go to this folder:
Run the installation script by running the following command:
(Anaconda3-2021.05-Linux-x86_64.sh should be replaced with the name of the file you downloaded).
Go through the installation procedure by following the prompts.
After the installation has finished, initialize Anaconda:
After that, the shell will be able to recognize commands for Anaconda.
You can check whether everything has gone correctly this way:
You should see the version of Conda.
This way you can establish work on several projects simultaneously. Use the following formula:
conda create --name myenv python=x.x
myenv should be replaced by the name of your environment and x.x with the Pything version.
Install the packages you need. Use conda to do it together with the name of your desired package:
conda install numpy
After finishing working with an Anaconda environmant, you may turn it off:
conda deactivate myenv
If you don’t need Anaconda for your projects anymore, you can also remove it from your system.
Open the terminal with the Ctrl+Alt+T keyboard shortcut or through your apps menu.
Before you start uninstalling Anaconda from your system, it’s a good thing to do to deactivate all Anaconda environments first.
Perform the uninstallation procedure. For this, you’ll need the Anaconda installer and apply the -uninstall option. To to the path where you installed Anaconda and execute such a script:
Although the previously described script performs Anaconda’s uninstallation, your system will still contain some traces of it, in particular, Anaconda-related lines in your shell configuration files (.bashrc, .zshrc, .profile, and so on). To do it you’ll need a text editor. For example, Nano. Let’s open .bashrc in it:
Find the lines that have to do with Anaconda or Conda. Delete them, save the file, and exit the editor.
Remove the remaining files related to Anaconda with the rm command. Keep in mind that this command deletes files and directories once and for all.
rm -rf ~/anaconda3
If you had Anaconda in a different folder, specify the corresponding location.
To check that Anaconda is no longer present on your device, you can use the conda command:
If the system doesn't recognize it, Anaconda is uninstalled.
Anaconda is a popular Python distribution that is pretty easy to use, which makes it popular amongst novice users. At the same time has a variety of features that will make it useful for data scientists and other scientists that have to do with data. It also enjoys a larger community, so by choosing it, you’ll certainly have a comfortable user experience. We hope that this guide was sufficient for you to understand all aspects of Anaconda’s installation. Thank you for your attention, stay tuned!
Yes, it’s possible. Since Anaconda allows you to have multiple isolated Python environments, one can have different Python installations and use them independently.
To create an environment on Anaconda use conda create, like this:
conda create --name myenv python=x.x
myenv is the name of your environment and x.x is the Python version.
To activate an Anaconda environment on Ubuntu 22.04 use:
conda activate myenv
Use conda to install packages:
conda install package_name
Yes, you can use pip interchangeable with conda for package installation.
To figure out, which version of Anaconda is installed on your Ubuntu 22.04, use: