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 (if on a Raspberry Pi, 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.
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.
cd ~/Downloads. If you didn't download the file to
Downloads, change it to wherever you downloaded the file to. Type
bash miniconda-file.sh, replacing
miniconda-file with the name of the file you downloaded. It should look something like
Miniconda3-latest-Linux-x86_64.sh This will start the installer.
yes and hit enter.
6: 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.
7: 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
If you get a list of packages, the installation was successful. Now for the slightly tricky part
8: If you want to install any packages using the
conda command, you will need to use
sudo conda install jupyter, but you may get a message "sudo: conda: command not found". Here's what you need to do:
9: 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.
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.
10: To test that the installation of Jupyter Notebooks was successful, open the terminal again and type
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.