We’ll point to tutorials and documentation created for OceanHackWeek (OHW) 2020 at the OHW Resources site. When reading these materials, ignore references to JupyterHub or “the Hub”. That’s a cloud-based deployment of Jupyter. For now, we’ll be working only on Jupyter in your own computer (“locally”).
To run OHW20 Python tutorials locally, use this conda environment file adapted by paring down the original OHW20 conda environment file, removing all R packages and other packages related to a JupyterHub deployment.
| [Setup Your Earth Analytics Python (conda), Git, Bash Environment On Your Computer Setup earth analytics environment Workshop | Earth Data Science - Earth Lab](https://www.earthdatascience.org/workshops/setup-earth-analytics-python/) |
| See [Introduction to Jupyter For Python | Earth Data Science - Earth Lab](https://www.earthdatascience.org/courses/intro-to-earth-data-science/open-reproducible-science/jupyter-python/). More broadly, you can check out the [Introduction to Earth Data Science | Earth Data Science - Earth Lab](https://www.earthdatascience.org/courses/intro-to-earth-data-science/) |
Go through these instructions. You may also find these materials very helpful:
| [Set Up Your Conda Earth Analytics Python Environment Setup earth analytics environment | Earth Data Science - Earth Lab](https://www.earthdatascience.org/workshops/setup-earth-analytics-python/setup-python-conda-earth-analytics-environment/) |
We’ll install Python (3.8) via the conda “open source package management system and environment management system”. The advantages of conda include:
conda can be installed in one of two ways, either with “Anaconda” or “Miniconda”. We’ll use Miniconda, which is much lighter weight than Anaconda, for your own personal use, you may find Anaconda more user friendly. Go to https://docs.conda.io/en/latest/miniconda.html Download the Windows Python 3.8 installer; I don’t know whether you’d use the 32bit or 64 bit one. I did my Windows testing on the 64bit version. If your computer is not too old, I suspect it’ll be 64bit; but pick the one that’s right for your computer.
Installation instructions for Windows are here. You can find MacOS instructions here, but the process should be pretty similar as on Windows (except that you can do it via the command line, I think).
Assuming you’re on Windows 10:
When installation is finished, from the Start menu, open the Anaconda Prompt or Anaconda Powershell Prompt; the latter will probably be nicer. Test it by running the command “conda list”
You’ll need to create a conda “environment” (a Python virtual environment) as needed, customized to the specific need. See this link for complete documentation, though it’s not needed here.
Install JupyterLab through a dedicated conda environment; see the User Guide section at https://jupyterlab.readthedocs.io. To install it, open the command shell (see #1 below) then create a new “jupyterlab3” conda environment as follows:
conda create -n jupyterlab3 -c conda-forge jupyterlab=3 nb_conda_kernels
conda environments can be specified and created using a text file called a conda environment file that lists the specific packages and versions that will be used. The environment file is constructed using the yaml format. To create the environment with such a file:
environment.yml file is located. For example: cd C:\Users\user1\fhlooconda env create -f environment.ymlconda activate MYENV.condarc fileFrom Don’s presentation. This file, copied into the user “home” folder, sets several useful and common conda defaults: https://raw.githubusercontent.com/lsetiawan/computer-setup/main/.condarc