Preparation

Before coming to the tutorial, please do the following:

  1. Have Python 3.7 installed in your laptop. Note: It’s important that you’re running Python 3.7 (or above) because we will use some of the new features added in 3.7 in this tutorial.

  2. Install the dependencies, preferably in a virtual environment. For this tutorial, we’ll use venv.

Create a new virtual environment using venv:

python3.7 -m venv .venv

Activate the virtual environment. On Unix, Mac OS:

source .venv/bin/activate

On Windows:

.venv\Scripts\activate.bat

Install the dependencies, listed in the requirements.txt file. You can download the file, or clone this repository:

(.venv) python -m pip install -U pip -r requirements.txt
  1. Verify that you correctly have Python 3.7 installed. If you’re able to run the following code, then you’re good to go.

import asyncio


async def main() -> None:
    print("Hello ...")
    await asyncio.sleep(1)
    print("... World!")


# Python 3.7+
asyncio.run(main())