Install Miniconda on CentOS 7 / RedHat 7

This post introduces how to install Miniconda on CentOS 7 / RedHat 7. 

(Tested on CentOS 7 / RedHat 7, but it should work for Ubuntu OS as well. Note that you can install Miniconda / Anaconda onto your Linux OS even when you are not a sudo / root user.)

(For installing Miniconda on Mac, check out this post.)

(For commonly used conda commands check this post.)

(For the comparison among Anaconda, Miniconda, and Virtualenv with pip, check this post.)

Step 1: Open a Terminal window, type

$ wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh

Step2:  Run the following bash script to install it

$ sh Miniconda3-latest-Linux-x86_64.sh

Step3: To make the changes take effect, close the terminal and open a new Terminal window. 

Step 4: Test conda

In the newly open Terminal window, type the following

$ conda -V

# If you see something like the following, it means Miniconda is successfully installed on your Linux OS.

conda 4.5.11

Step 5: Uninstalling Miniconda

To uninstall Python Anconda/Miniconda, we just simply remove the installation folder and remove the environment variables set in .bashrc file. For my installation, it will be just like this.

$ rm -rf /usr/local/miniconda/
$ rm -rf /usr/local/anaconda/

Then, you can edit the ~/.bashrc file and remove the following entries added for Anaconda/Miniconda directory from your PATH environment variable

$ export PATH=" /usr/local/anaconda/bin:$PATH" 
$ export PATH=" /usr/local/miniconda3/bin:$PATH" 

 

 

For commonly used conda commands check this post.

For the comparison among Anaconda, Miniconda, and Virtualenv with pip, check this post.

References:

 

Install Miniconda on Mac

This post introduces how to install Miniconda on Mac.

(For installing Miniconda on Linux OS, check out this post.)

(For commonly used conda commands check this post.)

(For the comparison among Anaconda, Miniconda, and Virtualenv with pip, check this post.)

Step 1: download  Miniconda (bash installer) from

https://docs.conda.io/en/latest/miniconda.html 

see the highlighted in the pic below.

A file called Miniconda3-latest-MacOSX-x86_64.sh will be shown in your Downloads folder.

Step 2: Open a Terminal window.

(If you don’t know how to open a terminal window,  through lauchpad type in Terminal, you will see the application.)

In the terminal window, type in

$ cd Downloads

Step 3: run the bash “shell” script to install Miniconda

In the terminal window, type in the following.

$ bash Miniconda3-latest-MacOSX-x86_64.sh

Scroll through the license (press the Space bar or Enter to move through quickly), type ‘yes’ to approve the terms, and then accept all the installation defaults.

Step 4: Close the Terminal window, and open a new Terminal window.

in the newly opened Terminal window.

Type the following:

$ conda -V

If you see something like the following, it means you have successfully installed conda via miniconda on your Mac.

conda 4.5.11

Step 5: Uninstalling Miniconda

To uninstall Python Anconda/Miniconda, we just simply remove the installation folder and remove the environment variables set in the hidden file .bash_profile in your home directory. For my installation, it will be just like this.

$ rm -rf /users/my-user-name/miniconda/
$ rm -rf /users/my-user-name/anaconda/

Then, you can edit the .bash_profile file and remove the following entries added for Anaconda/Miniconda directory from your PATH environment variable.

# added by Miniconda3 installer
$ export PATH="/Users/my-user-name/miniconda3/bin:$PATH"
# added by Anaconda3 installer
$ export PATH="/Users/my-user-name/anaconda3/bin:$PATH"

If you do not know where the hidden .bash_profile is located and how to edit it, see below for detailed instructions.

(1) Open a new terminal and go to your home directory. You can do this by using the command below.

$ cd

(2) use the following command to list all files, including hidden files in your home directory.

$ ls -a 
# you should see there is a file called .bash_profile.

(3) Use the cat command to see the contents of the hidden file .bash_profile. Type the following command into your terminal.

$ cat .bash_profile

You will see something like the following (depends on what you installed, if you installed Miniconda3, you will only see the first two lines. If you installed Anaconda3, you will see the bottom two lines.

# added by Miniconda3 installer 
$ export PATH="/Users/my-user-name/miniconda3/bin:$PATH" 

# added by Anaconda3 installer 
$ export PATH="/Users/my-user-name/anaconda3/bin:$PATH"

(4) To remove installed Miniconda/Anaconda from your .bash_profile use the command below to edit the file using the nano editor.

$ nano .bash_profile

Remove the Miniconda /Anoconda path in your .bash_profile hidden file.

Then Type control + X to exit out of nano

Save changes by typing Y.

Close the terminal, and now Miniconda/Anaconda should be successfully uninstalled from your Mac.

 

(Tested on macOS Mojave. Note that you can install Miniconda onto your Mac even when you are not an admin user.)

For commonly used conda commands check this post.

For the comparison among Anaconda, Miniconda, and Virtualenv with pip, check this post.

 

 

 

 

 

 

Anaconda vs. Miniconda vs. Virtualenv

This post briefly introduces which to choose among Anaconda, Miniconda, and Virtualenv.

If you have used pip and virtualenv in the past, you can use conda to perform all of the same operations. Pip is a package manager, and virtualenv is an environment manager; and conda is both.

Specifically, conda is a packaging tool and installer that aims to do more than what pip does; it handles library dependencies outside of the Python packages as well as the Python packages themselves. Conda also creates a virtual environment, like virtualenv does.

Both Anaconda and Miniconda uses Conda as the package manager. The difference among Anaconda and Miniconda is that Miniconda only comes the package management system. So when you install it, there is just the management system and not coming with a bundle of pre-installed packages like Anaconda does. Once Conda is installed, you can then install whatever package you need from scratch along with any desired version of Python.

Choose Anaconda if you:

  • Are new to conda or Python
  • Prefer having Python and 720+ open source certified packages automatically installed at once
  • Have the time and disk space (a few minutes and 3 GB), and/or
  • Don’t want to install each of the packages you want to use individually.

Choose Miniconda if you:

  • Know what package(s) you need to install
  • Do not have time or disk space (about 3 GB) to install over 720+ packages (many of the packages are never used and could be easily installed when needed), and/or
  • Just want fast access to Python and the conda commands, and prefer to sorting out the other packages later.

Choose Virtualenv only when you have sudo access to the machine you are working on. It is much easier to setup conda rather than virtualenv for a regular (i.e., non sudo/root) user on a linux/Mac machine.

I use Miniconda myself (because it is much more light weight than Anaconda) when I need to setup python programming environment and when I do not have sudo privilege, and I use Virtualenv when I have sudo access on the machine.

(Thanks to  Dr. Brendt Wohlberg  for introducing Miniconda — Miniconda makes me switching from pip & virtualenv to conda.)

References