From ef5ddb3a24c3dc359b4aef862d52b6563bb337a5 Mon Sep 17 00:00:00 2001 From: Gabriele Filomena Date: Wed, 20 Mar 2024 16:02:02 +0000 Subject: [PATCH] Add files via upload --- docs/general/setup.html | 624 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 624 insertions(+) create mode 100644 docs/general/setup.html diff --git a/docs/general/setup.html b/docs/general/setup.html new file mode 100644 index 0000000..d1edc19 --- /dev/null +++ b/docs/general/setup.html @@ -0,0 +1,624 @@ + + + + + + + + + +Web Mapping and Geovisualisation - Setting up the Working Environment + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+ +
+ + +
+ + + +
+ +
+
+

Setting up the Working Environment

+
+ + + +
+ + + + +
+ + +
+ +

Follow the instructions for yuour Operating System and test your installation. If you experience any issues, write a message on the Ms Teams channel of the module. Setting up the Python environment is necessary for:

+
    +
  • Executing the Jupyter Notebooks of the Lab sessions of the course.
  • +
  • Preparing your own Jupyter Notebooks for the assignments (one each).
  • +
+

We will use Minconda to handle our working environment. Miniconda is a free minimal installer for conda. It is a small bootstrap version of Anaconda that includes only conda, Python, the packages they both depend on, and a small number of other useful packages (like pip, zlib, and a few others)

+
+

Set up Miniconda (and Python) on Ms Windows

+
+

Installation

+
    +
  1. Install Miniconda: +
      +
    • Option 1: On a UoL Machine: Download and install Miniconda from here. This will install Miniconda and Python in C:\. If this process is aborted because it requires administrator rights, press Start, select Install University Applications, type and choose Miniconda.
    • +
    • Option 2, Recommended: Install Miniconda on your personal Laptop: Follow the instructions here.
    • +
  2. +
  3. During the installation, leave the default settings. In particular, when asked whom to “Install Miniconda for”, choose “Just for me”.
  4. +
+

Important: If you do choose to work on University Machines you will have to reinstall Miniconda every lab session unless you use a PC where Miniconda has been installed already.

+

Alternatively, you can work on the lab notebooks directly on the web. This does not require to install Miniconda. However, it represents a much slower option, especially when setting up the environment. To do so, you can access the data and the lab notebooks in the \labs directory from a virtual copy of the course repository here. If you opt for this option, you do not need to follow the rest of the instructions below.

+
+
+

Set up the Directories

+
    +
  1. Create a folder where you want to keep your work conducted throughout this course. For example, call it envs456. You can save it wherever you want. If you are working on a university machine, it could be worth creating it in M:/, which should your “virtual” hard-disk.
  2. +
  3. Download the data and the images for running and rendering the jupyter notebooks.
  4. +
  5. Unzip the folders and move the nested folders into the folder envs456.
  6. +
  7. Create another folder called labs
  8. +
+

The folder structure should look like:

+
envs456/
+├── data/
+├── labs_img/
+└── labs/
+
+
+

Set up the Python Environment

+
    +
  1. Download the envs456.yml from GitHub by cliciking Download raw file, top right at this page
  2. +
  3. Save it in the folder envs456 created before.
  4. +
  5. Type in the search bar and find the Anaconda Prompt (miniconda 3). Launch it. The terminal should appear.
  6. +
+

+
    +
  1. In the Anaconda Terminal write: conda env create -n envs456 --file C:\envs456\envs456.yml and press Enter; if the file is located elsewhere you’ll need to use the corresponding file path.
  2. +
  3. If you are prompted any questions, press y. This process will install all the packages necessary to carry out the lab sessions.
  4. +
  5. In the Anaconda Terminal write conda activate envs456 and press Enter. This activates your working environment.
  6. +
  7. Necessary on University machines, otherwise Optional: Configuration of Jupyter Notebooks +
      +
    • In the Anaconda Terminal, write jupyter server --generate-config and press enter. This, at least in Windows, should create a file to: C:\Users\username\.jupyter\jupyter_server_config.py.
    • +
    • Open the file with a text editor (e.g. Notepad++), do a ctrl-f search for: c.ServerApp.root_dir, uncomment it by removing the and change it to c.ServerApp.notebook_dir = 'C:\\your\\new\\path, for example the directory where you created the envs456 folder. In the University Machines, it is advised to work on the directory M:\.
    • +
    • Save the file and close it.
    • +
  8. +
+

+
+
+

Start a Lab Session

+
    +
  1. Download the Jupyter Notebook of the session in your folder. Choose one jupyter notebook and click Dowload raw file as shown below
  2. +
+

+
    +
  1. Save the file in the labs folder within your envs456 folder on your machine.
  2. +
  3. Type in the search bar, find and open the Anaconda Prompt (miniconda 3).
  4. +
  5. In the Anaconda Terminal write and run conda activate envs456.
  6. +
  7. In the Anaconda Terminal write and run jupyter notebook. This should open Jupyter Notebook in your default browser.
  8. +
+

+
    +
  1. Navigate to your course folder in and double click on the notebook downloaded in step 1.
  2. +
  3. You can now work on your copy of the notebook.
  4. +
+

Follow these instructions and test your installation prior to the first Lab Session (Wed, 31st of January). If you experience any issues, write a message on the Ms Teams channel of the module. Setting up the Python environment is necessary for:

+
    +
  • Executing the Jupyter Notebooks of the Lab sessions of the course.
  • +
  • Preparing your own Jupyter Notebooks for the assignments (one each).
  • +
+
+
+
+

Set up Miniconda (and Python) on MAC

+
+

Installation

+

To install Miniconda on your personal laptop, Follow the instructions here. During the installation, leave the default settings. In particular, when asked whom to “Install Miniconda for”, choose “Just for me”.

+
+
+

Set up the Directories

+
    +
  1. Create a folder where you want to keep your work conducted throughout this course. For example, call it envs456. You can save it wherever you want. For example, Elisabetta has named her folder envs456 and it’s in her Dropbox in Users/PIETROST/Library/CloudStorage/Dropbox/envs456
  2. +
  3. Download the data and the images for running and rendering the jupyter notebooks.
  4. +
  5. Unzip the folders and move the nested folders into the folder envs456.
  6. +
  7. Create another folder called labs
  8. +
+

The folder structure should look like:

+
envs456/
+├── data/
+├── labs_img/
+└── labs/
+

+
+
+

Set up the Python Environment

+
    +
  1. Download the envs456.yml from GitHub by cliciking Download raw file, top right, at this page
  2. +
  3. Save it in the folder envs456 created before.
  4. +
  5. Type in the search bar and open the Terminal.
  6. +
  7. In the Terminal write conda env create -n envs456 --file envs456.yml and press Enter. This will need to be modified according to where you placed the envs456 folder. For example, Elisabetta has named her folder envs456 and it’s in her Dropbox in Users/PIETROST/Library/CloudStorage/Dropbox/envs456/envs456.yml. If you created the envs456 folder on your desktop, the path would be Desktop/envs456.
  8. +
+

+
    +
  1. If you are prompted any questions, press y. This process will install all the packages necessary to carry out the lab sessions.
  2. +
+
+
+

Start a Lab Session

+
    +
  1. Download the Jupyter Notebook of the session in your folder. Choose one jupyter notebook and click Dowload raw file as shown below
  2. +
+

+
    +
  1. Save the file in the labs folder within your envs456 folder on your machine.
  2. +
  3. Type in the search bar, find and open the Terminal.
  4. +
  5. In the Terminal write and run conda activate envs456.
  6. +
  7. In the Terminal write and run jupyter notebook.
  8. +
+

+
    +
  1. This should open Jupyter Notebook in your default browser. You should see something like this:
  2. +
+

+
    +
  1. Navigate to your folder. You can now work on your copy of the notebook.
  2. +
+ + +
+
+ +
+ + +
+ + + + + \ No newline at end of file