Update the installation notes to JupyterLab

This commit is contained in:
Alexander Hess 2020-01-28 18:23:55 +01:00
commit e8cd8a7e63
6 changed files with 49 additions and 24 deletions

View file

@ -91,33 +91,52 @@ Just go to the [download](https://www.anaconda.com/distribution/#download-sectio
section and install the latest version (i.e., *2019-10* with Python 3.7 at the
time of this writing) for your operating system.
Then, among others, you will find an entry "Jupyter Notebook" in your start
Then, among others, you will find an entry "Anaconda Navigator" in your start
menu like below.
Click on it and a new tab in your web browser will open where you can switch
between folders as you could in your computer's default file browser.
Click on it.
<img src="static/anaconda.png" width="50%">
<img src="static/anaconda_start_menu.png" width="30%">
To download the course's materials as a ZIP file, click on the green "Clone or
download" button on the top right on this website.
Then, unpack the ZIP file into a folder of your choosing (ideally somewhere
within your personal user folder so that the files show up right away).
A window opens showing you several applications that come with the Anaconda
Distribution.
Now, click on "JupyterLab."
<img src="static/anaconda_navigator.png" width="50%">
A new tab in your web browser opens with the website being "localhost" and some
number (e.g., 8888).
This is the [JupyterLab](https://jupyterlab.readthedocs.io/en/stable/)
application that is used to display and run the Jupyter notebooks mentioned
above.
On the left, you see the files and folders in your local user folder.
This file browser works like any other.
In the center, you have several options to launch a new notebook file.
<img src="static/jupyter_lab.png" width="50%">
Next, to download the course's materials as a ZIP file, click on the green
"Clone or download" button on the top right on this website.
Then, unpack the ZIP file into a folder of your choosing, ideally somewhere
within your personal user folder so that the files show up right away in
JupyterLab.
### Alternative Installation
### Alternative Installation (for Instructors)
Python can also be installed in a "pure" way as obtained from its core
development team (i.e., without any third-party packages installed).
However, this is somewhat too "advanced" for a beginner as it involves working
with a terminal emulator, which looks similar to the picture below and is
used without a mouse by typing commands into it.
However, this may be too "advanced" for a beginner as it involves working
with a [terminal emulator](https://en.wikipedia.org/wiki/Terminal_emulator),
which looks like the one in the picture below and is used *without* a mouse by
typing commands into it.
<img src="static/terminal.png" width="50%" align="center">
Assuming that you already have a working version of Python 3.7 or higher
installed (cf., the official [download page](https://www.python.org/downloads/)),
the following summarizes the commands to be typed into a terminal emulator to
get the course materials up and running on a local machine without Anaconda.
get the course materials up and running on a local machine without the
Anaconda Distribution.
You are then responsible for understanding the concepts behind them.
First, the [git](https://git-scm.com/) command line tool is a more professional
@ -156,17 +175,23 @@ are popular tools to automate the described management of virtual environments.
After activation for the first time, you must install the project's
**dependencies** (= the third-party packages needed to run the code), most
notably [Jupyter](https://pypi.org/project/jupyter/) in this project (the
"python -m" is often left out [but should not be](https://snarky.ca/why-you-should-use-python-m-pip/);
notably [JupyterLab](https://pypi.org/project/jupyterlab/) in this project
(the "python -m" is often left out [but should not be](https://snarky.ca/why-you-should-use-python-m-pip/);
if you have poetry installed, you may just type `poetry install` instead).
- `python -m pip install -r requirements.txt`
The *requirements.txt* file also installs the [black](https://github.com/psf/black)
tool (incl. the [blackcellmagic](https://github.com/csurfer/blackcellmagic)
extension) and the [RISE](https://github.com/damianavila/RISE) extension.
With them, the instructor can easily re-format code in a class session and
execute code in presentation mode (currently RISE only works with the
older `jupyter notebook` command).
With everything installed, you can now do the equivalent of clicking the
"Jupyter Notebook" entry in your start menu.
"JupyterLab" entry in the Anaconda Navigator.
- `jupyter notebook`
- `jupyter lab`
This opens a new tab in your web browser just as above.