-
Notifications
You must be signed in to change notification settings - Fork 22
Running Jupyter Notebooks Locally
To get the tutorial contents locally, clone the github repository.
$ git clone https://github.com/geohackweek/tutorial_contents.git
This repo contains all of the materials for GeoHackWeek 2017. In order for us to run the notebooks within each tutorial, we need to run Jupyter Notebook.
Instruction to install conda: https://geohackweek.github.io/preliminary/01-conda-tutorial/ Tutorial for working with conda: https://geohackweek.github.io/Introductory/01-conda-tutorial/
-
Jupyter notebooks can be easily installed within a conda environment. To do this, go ahead and open up your terminal and run the command below. This will install jupyter notebooks and their dependencies.
$ conda install -c conda-forge jupyter
-
Once
jupyter
is installed, you can runjupyter notebook
and a jupyter notebook should open up on your default browser. If not, you can go back to your terminal and see the url.Copy/paste this URL into your browser when you connect for the first time, to login with a token: http://localhost:8888/?token=dd82f1e1d85a38d5b0d65768420274e25c8fd11c7a9a6626
Note:
- The default python
environment/kernel
for the jupyter notebook is the conda environment where you ran thejupyter notebook
command. In the example above, this is the root. - The directory where you ran
jupyter notebook
is the root directory of the jupyter notebook.
- The default python
-
To shutdown the jupyter notebook, make sure that you save your notebooks by using
command + s
orctrl + s
, then go back to your terminal and doingctrl + c
.
You will only need to install nb_conda_kernels
once within your root conda environment, since you will be able to switch between conda environments afterwards within the notebook. Open up your terminal and make sure that you are on the root conda environment by typing conda env list
; the activated environment is starred *
.
Run the command below to install the packages.
$ conda install -c conda-forge ipykernel nb_conda_kernels
Note: For nb_conda_kernels
to see your other conda environments, you need to install ipykernel
in those conda environment.
Go to the tutorial_contents
folder and run the command below.
$ conda env create -f ghw_environment.yml
This will install a conda environment named geohackenv
. You can use this environment for your vector and raster geospatial work. One thing to note is that this environment is running python 2.7
.
I you would like to install the conda environment for each tutorial separately, you can go into the tutorial's subfolder and create the environment from environment.yml
file.