π§ͺπ₯ Week 5 - Set up Local Jupyter Notebooks#
In this lab, you will install software to run Jupyter Notebooks locally so that you can complete your assignments on your own computer.
A. Install Anaconda#
Please choose the appropriate subsection based on whether you use a computer with Windows, Mac, or Linux.
Windows#
Open this link to download Anaconda in a browser tab.
Follow the instructions in the documentation below.
from IPython.display import IFrame
IFrame(src="https://docs.anaconda.com/anaconda/install/windows/", width=1200, height=600)
MacOS#
Click the Apple in the upper left corner of your screen, and choose βAbout this Macβ from the drop down menu.
In the window that pops up, look for the word Processor.
If the words following Processor include βIntelβ, follow the instructions under #### Intel below.
If the words following Processor include βM1β, βM2β, or βM3β, follow the instructions under #### M1-3 below.
Intel#
Go to Anaconda downloads.
Click the link titled 64-Bit Graphical Installer (610.5 MB) under the Mac logo.
M1-3#
Go to Anaconda downloads.
Click the link titled 64-Bit (M1) Graphical Installer (643.9 MB) under the Mac logo.
Continue below#
Follow the instructions below starting at Step 2.
IFrame(src="https://docs.anaconda.com/anaconda/install/mac-os/", width=1200, height=600)
Linux#
Open this link to download Anaconda in a browser tab.
Follow the instructions in the documentation below.
IFrame(src="https://docs.anaconda.com/anaconda/install/linux/", width=1200, height=600)
B. Install JupyterLab#
Open the Anaconda Navigator application you just installed.
Click βInstallβ under JupyterLab.
1a. If βLaunchβ appears under JupyterLab instead of βInstallβ, then you do not need to take this step.
from IPython.display import Image
# Specify the filename of the image in the same folder
image_filename = 'installJupyterLab.jpg'
# Display the image
Image(filename=image_filename)

C. Create an Environment for ENGR 131#
Download this file to a location where you can find it. Do not change the file name, which should be
engr131_24.yml
.In Anaconda Navigator, click Environments on the left navigation panel.
Click Import at the bottom of the window.
Choose the file that you downloaded in Step 0. Leave the new environment name as
engr131_24
.Click Import.
Make sure that engr131_24 is now in the list under βbase(root)β and is highlighted in green. Click the name βengr131_24β to select it if it is not green.
from IPython.display import Image
# Specify the filename of the image in the same folder
image_filename = 'envImport.jpg'
# Display the image
Image(filename=image_filename)

D. Launch JupyterLab#
In Anaconda Navigator, click the Home button in the left navigation panel.
Find JupyterLab (not Jupyter notebooks) in the applications panel.
Click βLaunchβ under JupyterLab.
# Specify the filename of the image in the same folder
image_filename = 'launchJupyterLab.jpg'
# Display the image
Image(filename=image_filename)

E. Create the engr131 Kernel#
Windows#
Go to Anaconda Navigator Home
Look for the CMD.exe PROMPT application, and click Install beneath it.
Launch CMD.exe PROMPT application by clicking Launch beneath it.
In the command prompt window that opens, enter exactly the following at the prompts.
conda activate engr131_24
conda install ipykernel
ipython kernel install --user --name=engr131
conda deactivate
Then, close the command prompt window. Proceed to Step F. Test JupyterLab with engr131 Kernel.
Mac or Linux#
In your default browser, JupyterLab should be open.
Click on βTerminalβ to open a terminal.
In the terminal window, enter the following at the prompts.
conda activate engr131_24
conda install ipykernel
ipython kernel install --user --name=engr131
conda deactivate
Then, close the terminal window by click the βxβ beside βTerminal 1β.
F. Test JupyterLab with engr131 Kernel#
In your default browser, JupyterLab should be open.
Click the button indicated below to upload the midterm .ipynb file (or a quiz .ipynb file that you have saved on your computer).
from IPython.display import Image
# Specify the filename of the image in the same folder
image_filename = 'uploadNotebook.jpg'
# Display the image
Image(filename=image_filename)

Click on the uploaded file name in the left panel to open it.
Click on the words βPython 3 (ipykernel)β in the upper right part of the window.
In the dialog box that opens, use the dropdown menu to choose the engr131 kernel.
Click the button indicated below to always start the preferred kernel. Then, click Select.
from IPython.display import Image
# Specify the filename of the image in the same folder
image_filename = 'selectKernelv1.jpg'
# Display the image
Image(filename=image_filename)

Try to execute the cells in the notebook.
Work with a TA or LA if you receive an error.
When running this file produces an output.log file in the panel on the left of the window, you have confirmed that you have a local JupyterLab working that you can use on future assignments.