How to install Anaconda (Python)

system
software

#1

When I installed Anaconda (actually, I installed Miniconda, but it should be just the same), it failed to work with sudo. So, here is my tutorial for how to install Anaconda successfully. (For those who may not know, Anaconda is an open-source Python distribution designed for large-scale data analysis. It comes with a Python package management system and many modules pre-downloaded.)

1: Download the .sh file from here. I recommend Miniconda because the full Anaconda package has about a thousand packages, mostly for data science, included, and it is several gigabytes in size. With Miniconda, you can download it much faster and still install whatever you need easily

2: From the Start Menu, go to System Tools>MATE Terminal. This will open up a Terminal session.

3: Type sudo -i and type your password when prompted. Nothing will appear as you type: this is normal and is a security feature. You will be shown a command prompt that looks like normal, except there will be a # instead of a $ at the end. Type cd ../home/username/Downloads, replacing username with your username. If you didn’t download the file to Downloads, change it to wherever you downloaded the file to. Type bash miniconda-file.sh, replacing minicondafile with the name of the file you downloaded. It should look something like Miniconda3-latest-Linux-x86_64.sh This will start the installer.

4: Hit enter to continue with the installation. You will be presented with a license and terms of use. The quickest way to go through this is to hit space; this will take you through a few lines at at time. You will be asked if you accept the license terms. Type yes and hit enter.

5: The default location should be good, so just hit enter. There will be several lines of installing: package that will appear, then you will be asked if you wish for the installer to prepend the Miniconda installation to your PATH. Type yes and hit enter.

6: You will be shown a message that the installation is finished and you will need to open a new Terminal session to use it. Type exit, hit enter, and close the terminal window. Open a new terminal session from Menu>System Tools> MATE Terminal. To test the installation, type conda list
If you get a list of packages, the installation was successful. Now for the slightly tricky part

7: If you want to install any packages using the conda command, you will need to use sudo, i.e. sudo conda install jupyter, but you may get a message “sudo: conda: command not found”. Here’s what you need to do:

8: Open a fresh terminal and type sudo -i typing your password when prompted.
This is the root shell, where you can do system stuff without having to type sudo every time.
Type conda list to confirm that it works. Then, type conda install jupyter
This will install Jupyter Notebooks, a useful took for writing Python code. Type y when asked if you wish to proceed and hit enter. It will take a little while to install. When it is done, you can exit the terminal.

9: To test that the installation of Jupyter Notebooks was successful, open the terminal again and type jupyter notebook
This will start the Jupyter Notebook, and a Firefox window will open with some stuff in it. You can close it. In the terminal, hit Ctrl+C twice to stop the notebook process.

You will not need to enter the root terminal with sudo -i every time you need to run Jupyter, but you will need to when you want to install a package.

Hopefully this is helpful to someone.
Joel