Download Python and Jupyter using Anaconda

Jul 19, 2023

DataSciencePursuit

What is Anaconda?

Anaconda is a free software made by data scientists for data scientists. It comes with Python and popular code editors and IDE's, in one install. It also has many packages/things data scientists need already installed.

Install Anaconda

  1. Navigate to the Anaconda Home Page
  2. The download button on the website should automatically detect your operating system. My operating system is windows, so it shows the windows logo. Click download if it is the correct operating system.
    Anaconda home page download button

    To see additional installers; click Get Additional Installers under the download button. The following window will appear.

    Anaconda home page download button

    Click the installer that applies to your operating system. Where available, we recommend the Graphical Installer. For linux the first installer should be good.

  3. An installer will be downloaded as a .exe file for windows (see image below), .pkg for Mac and .sh for Linux. Once it is downloaded, open the installer by clicking it from your browser or downloads folder. It may take a bit of time to open.
  4. Anaconda windows installer download

    Note: the next few steps show the graphical installer for windows which should look similar to the Mac one. However the installation for Linux is quite different, please refer to this Anaconda installation instructions for Linux, Python 3.7 or higher.

  5. Once the installer is open (as in the image below); click Next to start the installation.
  6. Anaconda windows installation start
  7. Agree to the terms and conditions.
  8. Anaconda windows installation terms and conditions

    The default selections should be good for the remaining prompts, we will can accept all prompts until the installation is done in the following steps. Feel free to choose different options if needed.

  9. If there are multiple users on your computer, you may get a prompt to install for all users or just you. To avoid admin issues you can install for just you, which is the default. Click Next.
  10. Anaconda windows installation for all users or just you
  11. Check that you have access to the path stated and click Next
  12. Anaconda windows installation directory path
  13. The default options here are good, click Install
  14. Anaconda windows installation options
    The installation may take around 5 minutes. Once done, click Next and Finish

Open Anaconda Navigator

Open Anaconda Navigator from your search bar (windows) or spotlight search (macOS) or terminal (linux)

Close a Notebook in JupyterLab with JupyterLite

It may take some time but Anaconda Navigator should open as in the image below. You can see the list of available IDE's, code editors and other applications. If the application is installed, you will see a Launch button for it. If not, you will see an Install button. As mentioned before, we will be using JupyterLab for this course. However it is good to see what else is available. Spyder is my second favorite as it has a similar structure to RStudio, the R IDE. For information on other IDEs, stay tuned for future blogs or google away.

Anaconda Navigator

Open JupyterLab

There are a couple of ways to open JupyterLab.

From Anaconda Navigator

The easiest option at this point is using the Anaconda Navigator. However, this can be slow to open so the other options may be preferable.

    You can open JupterLab from here by clicking Launch under Jupyterlab. You can launch other applications the same way as well. But opening the navigator can be slow, we will show you faster ways in the next step. For now close the navigator.

    New blank notebook in JupyterLab with JupyterLite
    JupyterLab should open in your browser.

From Jupyter Notebook

You can open Jupyter Notebook without opening Anaconda Navigator, but not JupyterLab. However you can easily open JupyterLab from Jupyter Notebook.

  1. Open Jupyter Notebook from search bar (windows) or spotlight search (macOS) or terminal (linux). This should open both a Jupyter Notebook terminal and the Jupyter Notebook home page in your browser. We will work in the browser, but the terminal should also stay open for Jupyter Notebook to work.
    Jupyter Notebook home page
  2. In the browser, replace the /tree at the end of the url with /lab and click enter, this should open JupyterLab
    Applications section of try jupyter page with three options, JupyterLab, Jupyter Notebook and Voila Jupyter Notebook home page

From Anaconda Prompt

  1. Open Anaconda Prompt, it should open as a terminal with a base folder path
    Anaconda prompt
  2. Type jupyter lab (all lowercaps with a space) and hit Enter, this should open JupyterLab in the browser
    Anaconda prompt - open JupyterLab
    Note: do not close Anaconda prompt while your JupyterLab file is still running.

JupyterLab

We should be in JupyterLab now.

JupyterLab

To the right you have the Launcher and to the left you have a navigation bar containing your folders. You can click through to go to the folder you want to work in for the next steps.

Create a new notebook

We should be in JupyterLab now. There are a couple of ways to create a notebook in JupyterLab. The easiest option now is using the Lancher:

Option 1 - Launcher

  1. Go to the Notebook section of the Launcher and click Python # (ipykernel) (# is the version number, mine is 3, but yours could be higher in the future)
    JupyterLab Launcher
  2. This will open a blank notebook titled Untitled.ipynb (you can find the name at the top of the notebook and in the left navigation section)
    New blank notebook in JupyterLab with JupyterLite

Option 2 - Sidebar

Another way to create a new notebook is:

  1. Right click on any empty space in the left navigation bar
  2. A pop-up will appear; click New Notebook
    Applications section of try jupyter page with three options, JupyterLab, Jupyter Notebook and Voila
  3. Another pop-up will appear; check that Python # (ipykernel) is selected as the Kernel and click Select
    Applications section of try jupyter page with three options, JupyterLab, Jupyter Notebook and Voila

Rename the notebook

  1. Right click on the name of your notebook ‘Untitled1.ipynb’ in the top tab (you can also right click it from the left navigation and a few more options will appear in the next step)
  2. Click Rename Notebook…in the options that pop up. (Note that there are other options like deleting a notebook etc.)
    Rename Jupyter Notebook
  3. Replace Untitled1 with a name of your choice. We chose “DSP Lesson 1”.
    Rename Jupyter Notebook
  4. Click Rename

Close JupyterLab properly

  1. Save your file by clicking the icon below
    Save Jupyter Notebook
  2. You can also close the notebook if you would like by clicking the X next to the name.
  3. Hover over File and some options will appear. Then click Shut Down (you may need to scroll down to see this option)
    Shut down Jupyterlab
  4. Click Shut Down again in the popup that appears. You will then get a message that the server has stopped and you can close the tab. Notice that the Jupyter Notebook terminal will also disappear if you opened JupyterLab from there. You can close the browser page for JupyterLab and the next time you need to open it just follow the same steps.

You are ready to start coding now!

Next step

Learn how to run Python in JupyterLab by using Python as a calculator.