Sanic is a modern Python web framework allowing us to use async/await keywords to speedup the process of running statements in an asynchronous function, just like async/await in ES6. To start learning this new technology, we need to install Sanic package in our project. However, to separate our Sanic project from the future projects, we need to create a virtual environment by running the command as below:

 

$ python3 -m venv myvenv

 

To activate this virtual environment in Linux, we need to write command as below:

 

$ source myvenv/bin/activate

 

In Windows, the command is slightly different:

 

myvenv/Scripts/activate

 

Once the virtual environment is activated, the command to install Sanic package is as below:

 

$ pip install sanic