Autograd, Optimization, Visualization

Ways to run Python

Three ways to run Python on Google servers, Your laptop or ACG.maine.edu

Outline

Easiest: Google colab

  1. Open https://colab.research.google.com/#create=true

  2. Enter any python code
    print("hello world!")
    

    Press Control+Enter to run

  3. The colab notebooks are saved in your Google drive > Colabs. You can organize them by clicking on File > Move

Install WSL (Windows subsystem for Linux)

  1. Install PowerShell on Windows Installing PowerShell on Windows

  2. List the Ubuntu versions available to be installed
    wsl --set-default-version 2
    wsl --list --online
    
  3. Install Ubuntu 22.04
    wsl --install -d Ubuntu-22.04
    
  4. Launch wsl: Press Windows, search wsl

Within WSL

In WSL>Ubuntu-22.04 python comes pre-installed.

  1. Launch WSL

  2. Type python3, press enter

  3. Enter any python code

    print("hello world!")
    

    Press enter.

Within WSL as a file

  1. Launch WSL

  2. Create a text file using notepad or your favorite editer. Enter any python code within the file.
    print("hello world!")
    

    Save the file as first.py

  3. From the terminal run the python script first.py
user@machine:~$ python3 first.py
hello world!

Install Jupyter lab

  1. Launch WSL

  2. Install pip
    user@machine:~$  sudo apt install python3-pip
    
  3. Install Jupyter lab using pip
    user@machine:~$  pip3 install --user jupyterlab
    
  4. Run Jupyter lab
    user@machine:~$  jupyter lab
    
  5. Click on Notebook > Python 3 > ipykernel

  6. Enter any python code
    print("hello world!")
    

    Press Ctrl+Enter

Optional: On ACG (Advanced computing group)

Please use this method only if your project has outscaled your laptop and colab.research.google.com resources.

  1. Request an account with acg.maine.edu by filling out this form

  2. In the “Department/Center/Institute” enter your department and in bracket course number (ECE490).

  3. Follow the PowerShell instructions here