How to install conda on linux

Installation

The fastest way to obtain conda is to install Miniconda , a mini version of Anaconda that includes only conda and its dependencies. If you prefer to have conda plus over 7,500 open-source packages, install Anaconda.

We recommend you install Anaconda for the local user, which does not require administrator permissions and is the most robust type of installation. You can also install Anaconda system wide, which does require administrator permissions.

For information on using our graphical installers for Windows or macOS, see the instructions for installing Anaconda.

System requirements

  • 32- or 64-bit computer
  • For Miniconda: 400 MB disk space
  • For Anaconda: Minimum 3 GB disk space to download and install
  • Windows, macOS, or Linux
  • For Windows: Windows 8.1 or newer for Python 3.9, or Windows Vista or newer for Python 3.8

You do not need administrative or root permissions to install Anaconda if you select a user-writable install location.

Regular installation

Follow the instructions for your operating system:

Installing in silent mode

You can use silent installation of Miniconda or Anaconda for deployment or testing or building services, such as GitHub Actions.

Follow the silent-mode instructions for your operating system:

Installing conda on a system that has other Python installations or packages

You do not need to uninstall other Python installations or packages in order to use conda. Even if you already have a system Python, another Python installation from a source such as the macOS Homebrew package manager and globally installed packages from pip such as pandas and NumPy, you do not need to uninstall, remove, or change any of them before using conda.

Install Anaconda or Miniconda normally, and let the installer add the conda installation of Python to your PATH environment variable. There is no need to set the PYTHONPATH environment variable.

To see if the conda installation of Python is in your PATH variable:

  • On Windows, open an Anaconda Prompt and run echo %PATH%
  • On macOS and Linux, open the terminal and run echo $PATH
Читайте также:  How to launch jar files linux

To see which Python installation is currently set as the default:

  • On Windows, open an Anaconda Prompt and run where python
  • On macOS and Linux, open the terminal and run which python

To see which packages are installed in your current conda environment and their version numbers, in your terminal window or an Anaconda Prompt, run conda list .

© Copyright 2017, Anaconda, Inc. Revision 70aeb745 .

Источник

How to install Conda on Ubuntu? [SOLVED]

Conda is an open source (BSD licensed), language-independent package manager and environment management system that runs on different operating systems (Windows, macOS and Linux). It was built for Python programs, but can package and distribute software for any language. Conda quickly installs, runs, and updates packages and their dependencies.

In this article, we will explain how to install Conda on Ubuntu.

Conda package and environment manager are included in all versions of Miniconda and Anaconda Repository. We will install Conda with these 2 methods on Ubuntu.

Method-1: Installing Conda with Miniconda

Miniconda is a free minimal installer for conda. Go to Miniconda official download address, copy the download link.

install Conda

Type the link after the wget command:

foc@ubuntu22:~$ wget https://repo.anaconda.com/miniconda/Miniconda3-py39_4.12.0-Linux-x86_64.sh --2022-12-21 19:48:18-- https://repo.anaconda.com/miniconda/Miniconda3-py39_4.12.0-Linux-x86_64.sh Resolving repo.anaconda.com (repo.anaconda.com). 104.16.131.3, 104.16.130.3, 2606:4700::6810:8203, . Connecting to repo.anaconda.com (repo.anaconda.com)|104.16.131.3|:443. connected. HTTP request sent, awaiting response. 200 OK Length: 76607678 (73M) [application/x-sh] Saving to: ‘Miniconda3-py39_4.12.0-Linux-x86_64.sh’ Miniconda3-py39_4 100%[=============>] 73.06M 645KB/s in 67s 2022-12-21 19:49:25 (1.08 MB/s) - ‘Miniconda3-py39_4.12.0-Linux-x86_64.sh’ saved [76607678/76607678]

Give execute permission to the downloaded «.sh» file:

foc@ubuntu22:~$ chmod +x Miniconda3-py39_4.12.0-Linux-x86_64.sh
foc@ubuntu22:~$ ./Miniconda3-py39_4.12.0-Linux-x86_64.sh
Welcome to Miniconda3 py39_4.12.0 In order to continue the installation process, please review the license agreement. Please, press ENTER to continue . Please answer 'yes' or 'no':' Miniconda3 will now be installed into this location: /home/foc/miniconda3 - Press ENTER to confirm the location - Press CTRL-C to abort the installation - Or specify a different location below [/home/foc/miniconda3] >>> PREFIX=/home/foc/miniconda3 Unpacking payload . . Preparing transaction: done Executing transaction: done installation finished. Do you wish the installer to initialize Miniconda3 by running conda init? [yes|no] yes . ==> For changes to take effect, close and re-open your current shell. 

Prefer that conda's base environment be activated on startup, set the auto_activate_base parameter to true:

foc@ubuntu22:~$ conda config --set auto_activate_base True

Upload completed successfully. Version:

(base) foc@ubuntu22:~$ conda -V conda 4.12.0

Method-2: Installing Conda with Anaconda

Anaconda is the world's most popular open source Python distribution platform. Go to the official download address for the Anaconda installation script and copy the link.

How to install Conda on Ubuntu? [SOLVED]

Pull the Anaconda3-2022.10-Linux-x86_64.sh file to your computer with wget:

foc@ubuntu22:~$ wget https://repo.anaconda.com/archive/Anaconda3-2022.10-Linux-x86_64.sh --2022-12-22 18:09:12-- https://repo.anaconda.com/archive/Anaconda3-2022.10-Linux-x86_64.sh Resolving repo.anaconda.com (repo.anaconda.com). 104.16.131.3, 104.16.130.3, 2606:4700::6810:8303, . Connecting to repo.anaconda.com (repo.anaconda.com)|104.16.131.3|:443. connected. HTTP request sent, awaiting response. 200 OK Length: 773428196 (738M) [application/x-sh] Saving to: ‘Anaconda3-2022.10-Linux-x86_64.sh’ Anaconda3-2022.10 100%[=============>] 737.60M 1.71MB/s in 7m 35s 2022-12-22 18:16:47 (1.62 MB/s) - ‘Anaconda3-2022.10-Linux-x86_64.sh’ saved [773428196/773428196]

Then give execute permission this file

foc@ubuntu22:~$ chmod +x Anaconda3-2022.10-Linux-x86_64.sh
foc@ubuntu22:~$ ./Anaconda3-2022.10-Linux-x86_64.sh Welcome to Anaconda3 2022.10 In order to continue the installation process, please review the license agreement. Please, press ENTER to continue >>>
. Do you accept the license terms? [yes|no] [no] >>> yes . Preparing transaction: done 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] . modified /home/foc/.bashrc ==> For changes to take effect, close and re-open your current shell. 

Anaconda installed, now reboot the system:

Then set it to be active on startup:

(base) foc@ubuntu22:~$ conda config --set auto_activate_base true

The conda version that comes with Anaconda:

(base) foc@ubuntu22:~$ conda -V conda 22.9.0

Update Conda

Updating Conda is very easy. For this, run the following command in terminal:

(base) foc@ubuntu22:~$ conda update conda Collecting package metadata (current_repodata.json): done Solving environment: done ## Package Plan ## environment location: /home/foc/anaconda3 added / updated specs: - conda The following packages will be downloaded: package | build ---------------------------|----------------- conda-22.11.1 | py39h06a4308_4 927 KB conda-package-handling-1.9.0| py39h5eee18b_1 946 KB conda-repo-cli-1.0.24 | py39h06a4308_0 115 KB ruamel.yaml-0.17.21 | py39h5eee18b_0 178 KB ruamel.yaml.clib-0.2.6 | py39h5eee18b_1 140 KB ------------------------------------------------------------ Total: 2.3 MB The following NEW packages will be INSTALLED: ruamel.yaml pkgs/main/linux-64::ruamel.yaml-0.17.21-py39h5eee18b_0 None ruamel.yaml.clib pkgs/main/linux-64::ruamel.yaml.clib-0.2.6-py39h5eee18b_1 None The following packages will be UPDATED: conda 22.9.0-py39h06a4308_0 --> 22.11.1-py39h06a4308_4 None conda-package-han~ 1.9.0-py39h5eee18b_0 --> 1.9.0-py39h5eee18b_1 None conda-repo-cli 1.0.20-py39h06a4308_0 --> 1.0.24-py39h06a4308_0 None Proceed ([y]/n)? y
Downloading and Extracting Packages conda-22.11.1 | 927 KB | ############################# | 100% ruamel.yaml-0.17.21 | 178 KB | ############################# | 100% conda-repo-cli-1.0.2 | 115 KB | ############################# | 100% ruamel.yaml.clib-0.2 | 140 KB | ############################# | 100% conda-package-handli | 946 KB | ############################# | 100% Preparing transaction: done Verifying transaction: done Executing transaction: done Retrieving notices: . working. done

The packages and sizes to be updated are listed, when you give your approval, the update is completed.

Remove Conda

If for some reason you want to uninstall Conda, the steps here should help. First, the following lines are deleted from the user's .bashrc file:

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

Then source the .bashrc file:

(base) foc@ubuntu22:~$ source ~/.bashrc foc@ubuntu22:~$

Directory selection was made during installation. If no changes are made, directories such as anaconda3/miniconda3 are created in the user's home directory. Delete this directory:

foc@ubuntu22:~$ rm -rf ~/anaconda3
foc@ubuntu22:~$ rm -rf ~/miniconda3

No more conda when you type conda in terminal:

foc@ubuntu22:~$ conda -bash: /home/foc/anaconda3/bin/conda: No such file or directory

Quit the active terminal and re-enter. Or reboot the system:

Now when you type in conda you get the following warning:

foc@ubuntu22:~$ conda conda: command not found

Summary

We explained how to install Anaconda and Miniconda and conda. We did the installation on Ubuntu 22.04. Although it was basically the same installation, miniconda provided faster and less packages to install conda. The choice is yours.

You can get local help with the --help parameter:

(base) foc@ubuntu22:~$ conda --help usage: conda [-h] [-V] command . conda is a tool for managing and deploying applications, environments and packages. Options: positional arguments: command clean Remove unused packages and caches. compare Compare packages between conda environments.

References

Didn't find what you were looking for? Perform a quick search across GoLinuxCloud

If my articles on GoLinuxCloud has helped you, kindly consider buying me a coffee as a token of appreciation.

Buy GoLinuxCloud a Coffee

For any other feedbacks or questions you can either use the comments section or contact me form.

Thank You for your support!!

Источник

Оцените статью
Adblock
detector