I got an error "prefect: command not found" - how to fix that?

This error indicates that your system cannot find Prefect installation on your system.

Your system may default to an older python version - to solve that, try running:

python3 -m prefect

or even using a specific Python version:

python3.8 -m prefect

Another possibility is that your system PATH does not include pip’s $HOME/.local/bin directory. On Linux, you can add this to your ~/.bashrc:

if [ -d "$HOME/.local/bin" ] ; then
    PATH="$HOME/.local/bin:$PATH"
fi

A more straightforward way of doing that is by exporting the following environment variable:

export PATH="$HOME/.local/bin:$PATH"