1.2. Set up¶
Tip
Please do all of these steps by Sunday before class starts! We offer extra credit for those of you that do. (See below.)
If you have any issues with or questions about the steps below, post them here. This link will work once you do step 2 below and subsequently accept the invitation to the organization.
Let’s install our programming “stack”.
-
Do not use your Lehigh username. My username is donbowen, not deb219.
Add a profile photo on GitHub, to make our exchanges and community more personal (don’t be a “Twitter egg”!)
Optional: Sign up for a student discount.
Join the class’s GitHub organization: Go to the coursesite for this class, and click the link to join the class’s “GitHub organization”.
Fill out this survey so we know your username and get to know you.
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
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 urlhttp://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 thereI recommend using the Powershell Prompt, because getting comfortable with that will be helpful
Bonus: Play around and explore Jupyter Lab. For a walkthrough 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).
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 withy/n?
)
Warning
If Mac users install Git via Xcode, you’ll have to install Xcode and essentially waste 4 GB of space you probably won’t be using.
Install GitHub Desktop. I accepted the default settings.
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.
Some students prefer to do all the coding in class in Visual Studio instead of Jupyter Lab. This is fine! Just know that I don’t use it regularly and won’t be much help on it.
A previous student, Noah Sutherland, recommended more extensions, which are listed below.1
Strongly recommended: Add some superpowers to JupyterLab to make coding easier.
To get extra credit, by Sunday before class starts (or within a day of joining the class if you’re a late add)
Fill out the survey above.
Email your TA your GitHub username and a screenshot of your computer where we can see GitHub Desktop and Jupyter Lab open.
When you get an email from GitHub saying you’ve been invited to the @LeDataSciFi organization, click the green button to join, and click the green button on the next page. Once you can see my office hours listed on our class discussion board, you’re set!
1.2.1. Steps 1-7 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 9: Adding superpowers to JupyterLab¶
These extensions will give you spellchecking, code hints, and automatic formatting for your code 😍.
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: There might be a problem installing the
variableinspector
. You can try this fix, but 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.
Now run
jupyter lab
in the terminal window to open Jupterlab.Click on settings, then Advanced Settings Editor. Click on the Keyboard Shortcuts menu. Then click on “JSON Settings Editor” and it will open a column called “User Preferences.”
Note Mac users might prefer to replace “Ctrl” with “Cmd” in the code below.
If the User Preferences side is empty, copy this in and hit the save button at the top right.
{ "shortcuts": [ { "command": "jupyterlab_code_formatter:format", "keys": [ "Ctrl Shift F" ], "selector": ".jp-Notebook.jp-mod-editMode" } ] }
If the User Preferences side is NOT empty, insert a new line under
"shortcuts": [
and paste this there, and then save it.{ "command": "jupyterlab_code_formatter:format", "keys": [ "Ctrl Shift F" ], "selector": ".jp-Notebook.jp-mod-editMode" },
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.)
Note: If the User Preferences side is NOT empty, omit the brackets.
{ "continuousHinting": true, }
- 1
Brack Pair Colorizer 2, Code Runner, Code Spell Checker, Excel Viewer, Github Pull Requests and Issues, indent-rainbow, Jupyter, Markdown All in One, Pylance, Python, Python Indent, Rainbow CSV, Visual Studio IntelliCode