Anaconda is a distribution of the python and R programming languages for scientific computing, that aims to simplify package management and deployment.
Anaconda is a solution for data science and machine learning, it’s very versatile. The reason many love Anaconda is:
- Can deliver your data strategy easily
- It maximizes flexibility and control
- Products get to the market faster
Install Anaconda
It is recommended that when installing Anaconda, don’t install using AUR packages, because AUR installs to the /opt directory which requires root to execute and Anaconda wants only the user with Sudo privileges.
1. Update system repositories
To update the Manjaro Linux we use the following command.
sudo pacman -Syu
2. Install Gui dependencies
We need to install the following packages to enable us to be in a position to use Gui functionalities. Go to your terminal and run the following
sudo pacman -Sy libxau libxi libxss libxtst libxcursor libxcomposite libxdamage libxfixes libxrandr libxrender mesa-libgl alsa-lib libglvnd
2. Download Anaconda for Linux
Go to this link in order to download the latest distribution of Anaconda
wget https://repo.anaconda.com/archive/Anaconda3-2022.10-Linux-x86_64.sh
After the download is complete, proceed to check the authenticity of the Anaconda with the use of the following sha script. Make sure you are in the directory you downloaded your Anaconda.
$ shasum -a 256 Anaconda3-2022.10-Linux-x86_64.sh
e7ecbccngtxs6577ebd7e1f211c59df2e37bc6959f2235d387e08c9026666acd Anaconda3-2022.10-Linux-x86_64.sh
3. Install Anaconda
Now, let’s start installing Anaconda with the use of bash. Make sure you have Python 3.7 and above.
bash Anaconda3-2022.10-Linux-x86_64.sh
Accept all the prompts given in the process for Anaconda to begin the installation.
Welcome to Anaconda3 2022.10
In order to continue the installation process, please review the license
agreement.
Please, press ENTER to continue
>>>
Executing transaction: |
Installed package of scikit-learn can be accelerated using scikit-learn-intelex.
More details are available here: https://intel.github.io/scikit-learn-intelex
For example:
$ conda install scikit-learn-intelex
$ python -m sklearnex my_application.py
done
installation finished.
Do you wish the installer to initialize Anaconda3
by running conda init? [yes|no]
[no] >>> yes
==> For changes to take effect, close and re-open your current shell. <==
If you'd prefer that conda's base environment not be activated on startup,
set the auto_activate_base parameter to false:
conda config --set auto_activate_base false
Thank you for installing Anaconda3!
4. Activate the virtual environment
Anaconda needs to be run in a virtual environment in order to isolate its working environment with your system to avoid installing dependencies globally.
To activate you may use of the following command
source <path to conda>/bin/activate
If you’d prefer that conda’s base environment not be activated on startup, set the auto_activate_base parameter to false: I will prefer this option because I run other processes with my machine.
conda config --set auto_activate_base false
Verify that conda has been installed with the following command.
conda list
You will be in a position to see many packages installed.
# packages in environment at /home/sang-pc/anaconda3:
#
# Name Version Build Channel
_ipyw_jlab_nb_ext_conf 0.1.0 py39h06a4308_1
_libgcc_mutex 0.1 main
_openmp_mutex 5.1 1_gnu
alabaster 0.7.12 pyhd3eb1b0_0
anaconda 2022.10 py39_0
anaconda-client 1.11.0 py39h06a4308_0
anaconda-navigator 2.3.1 py39h06a4308_0
anaconda-project
....
You can also use python
command to verify Anaconda.
$ python
Python 3.9.13 (main, Aug 25 2022, 23:26:10)
[GCC 11.2.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>
Another way to verify is to use anaconda-navigator
, this will open a GUI application.
anaconda-navigator
Uninstall Anaconda
To fully uninstall Anaconda from your system, use the following command.
conda install anaconda-clean
Follow the promts in order to run uninstaller
Collecting package metadata (current_repodata.json): done
Solving environment: done
## Package Plan ##
environment location: /home/sang-pc/anaconda3
added / updated specs:
- anaconda-clean
The following packages will be downloaded:
package | build
---------------------------|-----------------
anaconda-clean-1.1.1 | py39h06a4308_0 8 KB
------------------------------------------------------------
Total: 8 KB
The following NEW packages will be INSTALLED:
anaconda-clean pkgs/main/linux-64::anaconda-clean-1.1.1-py39h06a4308_0 None
Proceed ([y]/n)? y
Then we need to use anaconda-clean
we have installed above to remove all the Anaconda packages. If you don’t want to be asked about each file and directory append --yes
anaconda-clean --yes
Then we need to remove the backup files made by anaconda from our system with the following command
rm -rf anaconda3
Conclusion
We have successfully installed Anaconda on Manjaro Linux. Go ahead and experiment with it now.