1.2. Set up

Tip

Please do all of these steps before the first class!

There is a youtube video at the bottom of this page, if you prefer that.

Let’s install our programming “stack”.

  1. Create a GitHub account. Please use your name in your username to make discussions easier. Then,

  2. Install Anaconda (not the Nicki Minaj song).

    • Install the latest version, make Anaconda your default Python installation, and accept all the defaults otherwise.

      • Mac users: The TA used the “64-Bit Graphical Installer (435 MB)”

    • Update Anaconda: Open up Anaconda Powershell Prompt (on windows, or terminal on Mac) and type

      conda update --all

      then click enter

  3. Test start Jupyter Lab (simply see if you can open it, then close it)

    • Open Anaconda Prompt (or terminal on a Mac) and type jupyter lab, click enter, and an internet tab should open with the url http://localhost:8888/lab. This is Jupyter Lab, and where we will code this semester!

    • The “point and click: option: Open Anaconda Navigator and launch Jupyter Lab from there

    • I recommend using the Powershell Prompt, because getting comfortable with that will be helpful

    • Bonus: Play around and explore Jupyter Lab. For a walkthough of what you’re seeing, this page should help.

    Tip

    Once Jupyter Lab is open, it often helps to open a second powershell window. This will let you run terminal commands, which you can’t do in the first powershell window (because that one is running jupyter lab).

  4. Install Git.

    • Mac users: Your TA installed Git via Homebrew. Go to https://brew.sh, copy the home-brew address (they have a little copy paste icon which makes it easier for students), then type brew install git into the terminal and it’ll install git. (There is no config necessary, type “y ” when prompted with y/n?)

    Warning

    If Mac users install Git via Xcode, you’ll have to install Xcode and essentially waste 4gb of space you probably won’t be using.

  5. Install GitHub Desktop. I accepted the default settings.

  6. Optional, but recommended: Install a good text editor. Atom, Sublime, or Visual Studio (this link includes suggestions for extensions) are the most popular according to prior students of this class.

  7. Strongly recommended: Add some superpowers to JupyterLab to make coding easier.

1.2.1. Steps 1-6 on video

I put together a video of me installing everything due to popular demand:

If you have completed all the steps above, you are ready to go! If you got stuck on a step, message the RA or post on the classmates group. We will get you going quickly!

1.2.2. Step 7: Setting up JupyterLab

These extensions will give you spell checking, code hints, and automatic formatting for your code 😍.

  1. Run these in terminal (Mac) or Anaconda Powershell Prompt (Windows) one at a time:

    pip install jupyterlab-spellchecker
    pip install jupyterlab_code_formatter
    pip install black
    pip install jupyterlab-lsp
    pip install python-lsp-server[all]
    pip install --upgrade lckr-jupyterlab-variableinspector 
    
    • Mac users: To install the spellchecker, your TA had to install node.js in order to install the spell checker extension. MacOS users who also installed homebrew can install this in terminal via brew install node.

    • Windows users: The last pip install command often fails. Use this fix. As of 2022, this fix isn’t working for everyone. If it doesn’t work on your computer, don’t worry - just skip ahead to the next step, and let me know.

  2. Now run jupyter lab in the terminal window to open Jupterlab.

  3. Click on settings, then Advanced Settings Editor. Click on the Keyboard Shortcuts menu. Then look to the right side of the screen: In the user preference box, add the text below. After you copy it in, save the user settings. (Either CTRL+S or using the the icon to the upper right of the user preference box.)

    {
    	"shortcuts": [
    		{
    			"command": "jupyterlab_code_formatter:format",
    			"keys": [
    				"Ctrl Shift F"
    			],
    			"selector": ".jp-Notebook.jp-mod-editMode"
    		}
    	]
    }
    
    • Mac users: You might want to use “Cmd” instead of “Ctrl”

  4. Still in the Advanced Settings Editor, Click on the Code Completion menu. Then look to the right side of the screen: In the user preference box, add the text below. After you copy it in, save the user settings. (Either CTRL+S or using the the icon to the upper right of the user preference box.)

    {
    	"continuousHinting": true,
    }