2- Installing Python, Pip, and Jupyter Notebooks

Introduction

Welcome to the part of the course where your computer skills will come in handy. Installing software can sometimes be tricky due to different operating systems and frequent updates. But don’t worry, we’ve got a comprehensive Troubleshooting document available in the Exercise Files and a Troubleshooting Wiki on GitHub to help you out.

Finding the Exercise Files

First, ensure you have the Exercise Files. They are located on the Overview tab of the Course page or can be accessed via the GitHub link provided. If you’re not familiar with GitHub, simply go to the GitHub page, click on “Code,” and then “Download ZIP.” Make sure to unzip the files and save them to an easily accessible location like your Documents or Desktop.

Installing Python

  1. Download Python: Go to python.org/downloads. The website will detect your operating system and display a big yellow download button for the latest version. Click to download and run the installer.
  2. Windows Users: During installation, select “Customize Installation,” click “Next,” and ensure you check “Add Python to environment variables.” This step is crucial to avoid issues later.
  3. Mac Users: After installation, you may get a popup—simply close it.

Accessing the Terminal

You’ll need to use your computer’s terminal to proceed:

  • Windows: Open Command Prompt by searching for “CMD” in the Start menu.
  • Mac: Navigate to Applications > Utilities > Terminal.
  • Linux: The terminal location varies by distribution; look up instructions specific to your Linux version.

Testing Python Installation

  1. Open the Terminal: Type python and hit Enter (on Mac, you may need to type python3).
  2. Python Command Prompt: You should see the Python command prompt indicated by >>>.
  3. Verify Version: Ensure the version number matches what you downloaded. On Mac, if you see a version starting with 2, type python3 to get the correct version.
  4. Test Python: Type 1 + 1 and hit Enter. You should see the result 2, indicating everything is working.

Exiting the Python Command Prompt

To exit the Python command prompt and return to the terminal:

  • Windows: Type Control + Z and hit Enter.
  • Mac/Linux: Type Control + D or type quit() and hit Enter.

Installing Pip and JupyterLab

  1. Verify Pip Installation: Type pip in the terminal. You should see a list of commands if Pip is installed correctly.
  2. Install JupyterLab: Type pip install jupyterlab and hit Enter. Wait for the installation to complete.

Navigating to Exercise Files

Change Directory: Use the cd command to navigate to the directory where your Exercise Files are stored. You can copy the folder path from File Explorer (Windows) or Finder (Mac) and paste it into the terminal.

				
					cd /path/to/your/ExerciseFiles

				
			
  1. Start JupyterLab: Type jupyter lab and hit Enter. This command starts the Jupyter Notebook server, and a browser window should open displaying your Exercise Files.

Using JupyterLab

  1. Open a Notebook: Click on any Notebook file in the browser window. Each cell in the Notebook contains a small chunk of Python code that you can run independently.
  2. Run Cells: Play around with running the cells to familiarize yourself with JupyterLab, as we will use it extensively throughout the course.

Alternative: Visual Studio Code

If you encounter issues with JupyterLab, you can use Visual Studio Code (VS Code) to work with Notebook files. Download it from code.visualstudio.com.

Conclusion

Now that you have Python, Pip, and JupyterLab installed, you’re ready to dive deeper into the course. These tools will be essential for your programming journey, so take some time to get comfortable with them. If you encounter any issues, remember to refer to the Troubleshooting document and Wiki, and don’t hesitate to ask questions in the Q&A section on the Course page. Happy coding!