Python Tutorial

ACM/SIAM Student Chapter
KAUST | 2017

Venue: University Library Computer Room,
Level 3
Dates: February 26 - March 2, 2017

How to install Python

Setup instructions

We recommend you install the all-in-one scientific Python distribution from Continuum Analytics (Anaconda). However, if you already have a Python distribution you can install all the necessary packages and their dependencies by using pip or easy_install installers.

In this series of tutorials we use the following packages:
NumPy, SciPy, Matplotlib, Seaborn, Scikit-Learn, and memory_profiler.
You will also need to access jupyter notebooks so in addition you should install the Jupiter package.


Python Installation:

A) You can install Anaconda by doing the following:

  1. Download the installer that matches your operating system and follow the instructions in the screen. You can choose between the Graphical Installer or the Command Line Installer.
  2. You are now ready to use Python. To test your installation open a terminal and run
    ipython
    You should see an interactive window that says you are using the Anaconda Python distribution. You can exit by typing
    quit()
  3. In addition with the 250 packages that automatically come with the Anaconda distribution we are going to use in Session 4 the package Scikit-Learn. You can install it by running in a terminal
    conda install scikit-learn

B) Alternatively, you can install a light version of Anaconda: Miniconda.

  1. First download the installer depending on your operating system from here.
  2. Depending on your operating system run the installation file. In Windows run the .exe file you downloaded and in Mac/Linux run in a terminal
    cd Downloads
    bash Miniconda3-latest-MacOSX-x86_64.sh
    provided you downloaded the Miniconda3-latest-MacOSX-x86_64 installer in the Downloads folder.
  3. To install the packages we are going to use in the tutorials, type in terminal
    conda install numpy scipy matplotlib jupyter memory_profiler seaborn scikit-learn


To view the notebooks of the tutorial series, first download the zip or tar file from the main page and extract it.
Then via a new terminal navigate to the folder you have downloaded the file. Type
jupyter notebook
and you will be able to see the notebooks for each session.

For the last session we are going to use the mpi4py package. To install it run in a terminal
conda install -c conda-forge mpi4py
You can test if the installation works by typing
mpiexec -n 4 python -m mpi4py ringtest

For any questions about the installation go to Anaconda documentation or email us at yiannis.hadjimichael@kaust.edu.sa.
[back to main page]