Numba tutorial materials for Scipy 2016
This is the repository for the Scipy 2016 tutorial. The tutorial will be presented as a set of Jupyter notebooks with exercises sprinkled throughout.
We strongly, strongly, strongly encourage you to use
condato install the required packages for this tutorial. There are non-Python dependencies required that make manual installation or installing with
Note also that this tutorial is written for Python 3.5. Most things will still work on Python 3.4. No guarantees of any kind are made that it will be compatible with Python 2.
This tutorial uses the Viridis colormap pretty much everywhere we can use a colormap. This colormap was first made available in matplotlib 1.5.0. Please upgrade if you have an earlier version installed.
environment.ymlfile in the root of this repository, e.g.
and then create the environment with
conda env create -f environment.yml
This will create a conda environment named
numbatutorialwith all of the required packages.
You can activate the environment with
source activate numbatutorial
or on Windows:
conda install jupyter ipython numpy numba line_profiler matplotlib
pip install line_profiler
Note: Do not use
line_profiler; the version available in
condadefault channels is out of date.
To install (specifically) Numba using
pip, you need to have LLVM 3.7 installed on your machine with both libraries and header files.
You should be able to do a
sudo apt-get install llvm-3.7-dev
You may also need to install
You can follow instructions here for getting LLVM installed on Windows.
Install XCode which includes LLVM
llvm-config.exe) file is in a non-standard location, set the
LLVM_CONFIGenvironment variable to point at the
pip install llvmlite
If that installed successfully then you can continue to install the rest of the dependencies (which are must less fussy)
pip install numpy matplotlib jupyter ipython numba line_profiler
pip install -r requirements.txt
No hands-on work requires these, but if you want to play with some of the examples. If you installed using either
requirements.txtthese are already installed.
conda install cython dask
pip install cython dask
We recommend you also install the Jupyter notebook extensions.
pip install https://github.com/ipython-contrib/IPython-notebook-extensions/archive/master.zip --user
Once they are installed, start a notebook server
and (assuming port 8888) navigate to
http://localhost:8888/nbextensionswhere you can choose which extensions to enable. One that is helpful (for us!) when using Numba in the notebook is the
Skip-Tracebackextension. You're welcome to enable whichever extensions you like (we're also fans of
Once you have downloaded all of the requires libraries/packages, you can run the
check_install.pyscript to confirm that everything is working as expected. Either download the file directly or clone this repository and then run
Check out the video of the live tutorial at SciPy 2016 (filmed Monday 11 July).