- Install a conda based package manager. We recommend Miniforge3 if you are setting up for the first time.
- Install VS Code
- Install 'code' command in PATH
Clone this repo and navigate into the dir:
git clone https://github.com/Adamtaranto/python-novice-dataframes.git
cd python-novice-dataframes
Set up a python environment with the packages we will be using:
Setup new micromamba environment.
# Create env and install packages from yml
micromamba env create --name pandas-workshop --file environment.yml
# Activate the environment
micromamba activate pandas-workshop
# Create env and install packages from yml
conda env create --name pandas-workshop --file environment.yml
# Activate the environment
conda activate pandas-workshop
pip install matplotlib numpy pandas scipy seaborn jupyterlab
Now you can launch Jupyter Lab.
jupyter lab
- Install GitBash
- Install VS Code If you are using VS Code on a windows machine you will also need to set your default shell as "GitBash".
- Install miniforge3
- Open a GitBash shell and run this command to enable Conda:
~/miniforge3/Scripts/conda.exe init bash
- From a new GitBash shell use
conda
to install packages:conda install -c conda-forge jupyterlab pandas numpy matplotlib seaborn scipy
Clone this repo and navigate into the dir:
git clone https://github.com/Adamtaranto/python-novice-dataframes.git
cd python-novice-dataframes
Launch Jupyter Lab.
jupyter lab
You can launch a in interactive Jupyter Lab session on the WEHI HPC (Milton) via Ondemand.
You must have a Milton HPC account and a VAST scratch workspace set up before using this option.
- Sign in to WEHI Ondemand.
- From Apps select Jupyter
- Under the option "Extra Jupyter arguments" enter:
--notebook-dir=/vast/scratch/users/$USER
- Open the Jupyter session. From the menu bar select
View >> Open JupyterLab
To install packages in a Jupyter session running on Milton you will need to install into a target location that is visible from the notebook.
# Define user package location
from os import environ
username = environ["USER"]
pkgdir = f"/vast/scratch/users/{username}/workshop-pkgs"
# Prepend PYTHONPATH
import sys
sys.path.insert(0, pkgdir)
# Install package
!pip install --target $pkgdir pandas
# Package should now be visible
import pandas
Click the Gitpod button at the top of this README to launch a gitpod workspace with all the required software pre-installed.
If you have a paid Gitpod account you can increase the timout limit on your workspace. Otherwise you will need to restart the workspace periodically.
# Increase gitpod timeout setting
gp timeout set 6h
Manually start Jupyter session
# Launch jupyter-lab
jupyter lab --NotebookApp.allow_origin='*' --NotebookApp.allow_remote_access=True --NotebookApp.token='' --NotebookApp.password='' --no-browser --port=8888
Note: See other gitpod settings here.