Regular readers of this website possibly can recall that we talked about how to install Anaconda. Anaconda is around 413 MB size and needs 3 GB of available disk space with collection of 720+ open source packages. Size of Miniconda is only 45.2 MB as it without the collection of 720 packages and Anaconda Navigator (desktop graphical user interface included in Anaconda which allows to launch applications, manage conda packages). Miniconda is light version of Anaconda which makes it suitable to install & run on server. Here is how to install Miniconda on Ubuntu/CentOS.
How to Install Miniconda on Ubuntu/CentOS
We need to run the following command to add the URL of source packages to the /etc/apt/sources.list
file :
1 | sudo echo "deb-src http://archive.ubuntu.com/ubuntu/ xenial main" >> /etc/apt/sources.list |
To update the package index and install the build dependencies, run following commands:
---
1 2 3 | apt update apt install curl wget vim python-pip git apt build-dep python3.5 |
Run the following commands to set the locale to en_US.UTF-8
:
1 2 3 4 5 6 7 | sudo locale-gen en_US.UTF-8 sudo localedef -i en_US -f UTF-8 en_US.UTF-8 export LANGUAGE=en_US.UTF-8 export LANG=en_US.UTF-8 export LC_ALL=en_US.UTF-8 sudo locale-gen en_US.UTF-8 sudo dpkg-reconfigure locales |
Actually bash script exists for making the installation work easy :
1 | https://repo.continuum.io/miniconda/ |
For Ubuntu, we will wget
this one :
1 | wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh |
Miniconda3-latest-Linux-x86_64.sh
‘s version number is 4.3.27.1 at the time of writing this guide :
1 | wget https://repo.continuum.io/miniconda/Miniconda3-4.3.27.1-Linux-x86_64.sh |
Miniconda 3 depends on Python 3.6 at minimum. Ubuntu 16.04 have 3.5.1. Therefore you need to build Python 3.6 or 3.7.
1 2 | apt update apt install gcc g++ make libncurses5-dev libreadline6-dev libssl-dev libgdbm-dev libc6-dev libsqlite3-dev libbz2-dev xz-utils patch wget tar curl patch bzip2 |
Now download and build :
1 2 3 4 5 6 7 8 9 | cd /tmp/ wget https://www.python.org/ftp/python/3.7.0/Python-3.7.0a1.tar.xz ## wget https://www.python.org/ftp/python/3.6.2/Python-3.6.2.tar.xz tar -xvf Python-3.7.0a1.tar.xz cd /tmp/Python-3.7* ./configure --prefix=/usr/local --exec-prefix=/usr/local make ## make test sudo make install |
Run the following command to start the installation of Miniconda:
1 | bash Miniconda3-latest-Linux-x86_64.sh |
Accept the license terms, specify your path where you want to install Miniconda or press “Enter” to accept the default location which is ~/miniconda3
. Select option YES when prompted by “Do you wish the installer to prepend the Miniconda3 install location to PATH in your ~/.bashrc?” Later reload :
1 | source ~/.bashrc |
To verify that Miniconda is installed, run the following commands to view its help page and version number:
1 2 | conda -h conda -V |