Antoine Chagnon-Larose

Alex-Antoine Fortin

Tuesday, Dec20-2016 Montreal, Qc, Canada

Just what you need

Download this script. It will help you strongly in making use of your newly instantiated AWS machine.

  1. Download python as a tarball and scp it from your desktop to your remote computer

    scp /your/local/path/yourPythonTarball.tar.xz your-host-alias:~/yourPythonTarball.tar.xz

  2. Run the script on your instance


Table of content

On Monday, Dec19-2016, my friend Antoine and I instantiated our first AWS machine. We chose a machine running on Debian. Later, we decided to start over with one running on Amazon Linux.

Below, you will find a description of the program we installed when we set-up our environment along with why we chose to install them


Our objective was to have python 2.7.12, a short list of python packages and Java up-and-ready on our AWS machine.

We assume that you have downloaded your private key and have set-up your Host, HostName, User, IdentityFile in your config file. If you need help with that, follow this link or that link. I highly recommend this webpage for setting up your ~/.ssh/config file

Here we go
  1. Download python as a tarball and scp it from your desktop to your remote computer

    scp /your/local/path/yourPythonTarball.tar.xz your-host-alias:~/yourPythonTarball.tar.xz

  2. It is of the highest importance to update yum so that it is pointing to the most recent version of the package it is allowing you to download

    sudo yum update

    If you are on debian it's time to get build-essential

    sudo apt-get install build-essential

  3. Math computation optimization (you need that for gcc and several python packages)

    Blas/Lapack ensure that mathematical computations are made in low-level languages and are dependencies for -- at least -- scipy.

    sudo yum install atlas
    sudo yum install atlas-devel
    sudo yum install blas
    sudo yum install blas-devel
    sudo yum install lapack
    sudo yum install lapack-devel

    If your machine is running on Debian, replace the above by:

    sudo apt-get install libblas-dev liblapack-dev

  4. Group install (Magic!!) - useful arrays of software

    Each groupinstall installs a vast array of useful tools that will save you countless headaches in the future

    Particularly, you want 'Development Tools' as it installs dependencies of scipy

    yum groupinstall
    sudo yum groupinstall 'Development Tools'
    sudo yum groupinstall 'Development Libraries'
    sudo yum groupinstall 'Java Development'
    sudo yum groupinstall 'System Tools'
    sudo yum groupinstall 'TeX support'

  5. Installing final dependencies. gcc-gfortran is a dependency for scipy


    sudo apt-get install gfortran


    sudo yum install gcc-gfortran

  6. Install Python 2.7.12 (or 2.7.13)

    mkdir home
    cd home
    mv Python-2.7.12.tar.xz home/Python-2.7.12.tar.xz
    tar xf Python-2.7.12.tar.xz
    cd Python-2.7.12
    make /usr/bin/
    sudo make install
    sudo yum install python-dev

  7. Packages!

    sudo pip install --upgrade pip
    sudo pip install numpy
    sudo pip install scipy
    sudo pip install cython
    sudo pip install pandas==0.19.0
    sudo pip install scikit-learn=0.18.1
    sudo yum install python-matplotlib
    sudo pip install statsmodels==0.6.1

    For matplotlib, consult their doc for the installation.

  8. Installing Java

    We wanted Java 1.8.0 installed on our instance. We had Java 1.7.0. It is important to install Java 1.8.0 first and then uninstall Java 1.8.0 or else you will be deleting files that you must have on your instances while installing Java 1.8.0.

    sudo yum install java-1.8.0-openjdk
    sudo yum install java-1.8.0-openjdk-devel
    sudo yum remove jva-1.7.0-openjdk