There's more...
To make our lives easier, we can use virtualenvwrapper, which, as the name suggests, is a wrapper written over virtualenv and makes the handling of multiple instances of virtualenv easier.
Remember that the installation of virtualenvwrapper should be done on a global level. So, deactivate any virtualenv that might still be active. To deactivate, use the following command:
$ deactivate
Install virtualenvwrapper using the following commands:
$ pip3 install virtualenvwrapper $ export WORKON_HOME=~/workspace $ source /usr/local/bin/virtualenvwrapper.sh
In the preceding code, we installed virtualenvwrapper, created a new environment variable with the name WORKON_HOME, and provided it with a path, which will act as the home for all virtual environments created using virtualenvwrapper.
To create a virtualenv and install Flask, use the following commands:
$ mkvirtualenv my_flask_env $ pip3 install flask
To deactivate a virtualenv, simply run the following command:
$ deactivate
To activate an existing virtualenv using virtualenvwrapper, run the following command:
$ workon my_flask_env