Steps for installing Anaconda and associated open source packages
2018-12-04 Last updated by Adam Lu
-
Download the installation bash script to:
~/Software/Anaconda3-5.1.0-Linux-x86_64.sh
or~/Software/Anaconda3-5.2.0-Linux-x86_64.sh
-
Check the md5sum against values here or here:
md5sum ~/Software/Anaconda3-5.1.0-Linux-x86_64.sh
md5sum ~/Software/Anaconda3-5.2.0-Linux-x86_64.sh
- Install Anaconda:
sudo bash /home/adam/Software/Anaconda3-5.2.0-Linux-x86_64.sh
+ When prompted for where to install, choose this: **`/opt/anaconda3`** (the `/opt` directory is accessible to all users)
- Change the
$PATH
environmental variable in login shells-
Method 1 (preferred): Add the following line to the file
/etc/bash.bashrc
:export PATH="$PATH:/opt/anaconda3/bin"
This will edit the environmental variable
$PATH
for all users. This is preferred over editing the/etc/environment
file. -
Method 2 (not preferred): Add
/opt/anaconda3/bin
to the first line of the file/etc/environment
:PATH="/opt/anaconda3/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games"
However, before logging out and logging back in, one would need to place the following in the
~/.bashrc
file:export PATH="/opt/anaconda3/bin:$PATH"
-
- Change the permissions so that anaconda can be updated and other packages can be installed:
sudo chown -R adam:LabFolks /opt/anaconda3
sudo chmod -R 775 /opt/anaconda3
- Update Anaconda:
conda update -n base conda
- Install the Anaconda compiler tools:
# Install the C compiler
conda install gcc_linux-64
# Install the C++ compiler
conda install gxx_linux-64
# Install the FORTRAN compiler
conda install gfortran_linux-64
- Install the GNU Scientific library:
# Install just the library
# sudo apt-get install libgsl0ldbl (obsolete?)
sudo apt-get install libgsl23
# Install the development package and binary
# sudo apt-get install gsl-bin libgsl0-dev
sudo apt-get install gsl-bin libgsl-dev
# Install the resources/documentations
sudo apt-get install gsl-doc-info gsl-doc-pdf gsl-ref-html gsl-ref-psdoc
# Install GSL within conda
conda install gsl
- Install RStudio:
# Install Rstudio from the R channel
conda install -c r rstudio
- Install other R packages through Anaconda:
# Install all packages from tidyverse (includes dplyr, readr, etc.)
conda install -c r r-tidyverse
# Install all packages in r-essentials
conda install -c r r-essentials
# TODO: Does not work: Install the R wrapper for the GNU scientific library
conda install -c r r-gsl
# Update all associated packages
conda update --all
- Within RStudio, install libraries to the Anaconda path:
# For swirl tutorials install.packages("swirl", "/opt/anaconda3/lib/R/library") # For bee-swarm plots that work with ggplot2 install.packages("ggbeeswarm", "/opt/anaconda3/lib/R/library") # For themes that work with ggplot2 install.packages("ggthemes", "/opt/anaconda3/lib/R/library") # For area under the curve (AUC) and more install.packages("DescTools", "/opt/anaconda3/lib/R/library") # TODO: Does not work: For PearsonDS install.packages("gsl", "/opt/anaconda3/lib/R/library") # For Pearson distributions install.packages("PearsonDS", "/opt/anaconda3/lib/R/library") # For install.packages("kableExtra", "/opt/anaconda3/lib/R/library") # For install.packages("googledrive", "/opt/anaconda3/lib/R/library") # For install.packages("R.utils", "/opt/anaconda3/lib/R/library") # For install.packages("plot3D", "/opt/anaconda3/lib/R/library")
- Install TeX Live:
```bash # For most LaTeX packages sudo apt-get install texlive
# For the titling package sudo apt-get install texlive-latex-extra
12. Install other Python tools
* [**Bokeh**](https://bokeh.pydata.org/):
```bash
conda install bokeh
```
* [**Rise**](https://anaconda.org/damianavila82/rise) (slideshows):
```bash
conda install -c damianavila82 rise
```
- Required for the `cv2` package (not working on fishfish)
```bash
conda install -c https://conda.binstar.org/menpo opencv
```
13. Create desktop shortcuts:
* To place in **Applications Menu**, copy the **.desktop** files to `/usr/share/applications/`:
```bash
cp -p ~/Settings_Anaconda/spyder3.desktop /usr/share/applications/
cp -p ~/Settings_Anaconda/rstudio.desktop /usr/share/applications/
```
* To create a **desktop shortcut**, copy the **.desktop** files to `/home/${user}/Desktop`:
```bash
cp -p ~/Settings_Anaconda/spyder3.desktop ~/Desktop/
cp -p ~/Settings_Anaconda/rstudio.desktop ~/Desktop/
```
* Or run the bash scripts:
```bash
/media/adamX/Settings_Linux/setup_desktopfiles.sh
/media/adamX/Settings_Linux/setup_all_desktopfiles.sh
```
14. The man command stopped working do to an incorrect link for `/opt/anaconda/bin/pager`
* Issue: See this [link](https://askubuntu.com/questions/623992/what-is-the-default-pager-used-by-man-pages).
* Workaround (note: different from that provided by the link):
```bash
# Backup the default link to pager
mv /opt/anaconda3/bin/pager /opt/anaconda3/bin/pager-backup
# Create a new link to original pager
ln -s /usr/bin/pager /opt/anaconda3/bin/pager
```
15. Spyder3 and Anaconda Navigator ran into **segfault**
- Issue: See this [link](https://github.com/spyder-ide/spyder/issues/6968).
- Workaround:
```bash
# Downgrade PyQT to version 5.6
conda install pyqt==5.6
```
16. Installed **[Open CV](https://opencv.org/)**:
- Followed [these instructions](https://anaconda.org/conda-forge/opencv), after following [these instructions](https://docs.opencv.org/3.4.1/d2/de6/tutorial_py_setup_in_ubuntu.html) (which was probably unnecessary). Typed these commands in a terminal:
```bash
# Install Open CV for Python through Anaconda
conda install -c conda-forge opencv
conda install -c conda-forge/label/broken opencv
# Install Open CV for Python (obsolete)
sudo apt-get install python-opencv
# Install Open CV documentation and data (obsolete)
sudo apt-get install opencv*
```
***
#### Old versions:
- Done on earlier versions of Ubuntu:
* Within RStudio, install the [**DescTools** library](https://www.rdocumentation.org/packages/DescTools/versions/0.99.19) (for `AUC()`): (Didn't work for Ubuntu 18!)
```R
install.packages("DescTools")
```
* Install the [**gsl** library](https://www.rdocumentation.org/packages/gsl/versions/2.1-1) (R wrapper for the GNU Scientific library): (Didn't work for Ubuntu 18!)
```R
install.packages("gsl")
```
* Install the [**PearsonDS** library](https://www.rdocumentation.org/packages/PearsonDS/versions/0.97) (for Pearson distributions): (Didn't work for Ubuntu 18!)
```R
install.packages("c")
```
- Attempted on 2018-12-04
```bash
# Removed packages that I thought to have interfered with r-ggbeeswarm, r-pearsonds && r-ggthemes
conda remove -c r r-microsoftr
conda remove -c r r-revoioq
conda remove -c r r-deployrrserve
conda remove -c r r-revoutilsmath
# Re-installed r-essentials
conda install -c r r-essentials
# These did not work
conda install -c conda-forge r-ggbeeswarm
conda install -c conda-forge r-ggthemes
conda install -c cramjaco r-pearsonds