Torizon: Installing and using pip3 (Flask)

You should use pip3 instead of pip that is used for the old (now no longer supported) python2 version.
In general, it is a good idea to explicitly reference python3 and pip3 in your scripts.
And we have a Visual Studio Code extension that can create that container for your, solving all those issues and also allowing you to deploy and debug the application on the target:

For packages that include native code or build native code on the target it may be a good idea to add them as debian packages and not via pip (this does not apply to Flask).