The generator for python has been introduced in the latest versions of Qt so it is probably not available in your 5.9.7 version of Qt, so you will have to install a more recent version, for example in my case I use version 5.15.2:
Usage: uic [options] [uifile]
Qt User Interface Compiler version 5.15.2
Options:
-h, --help Displays help on commandline options.
--help-all Displays help including Qt specific options.
-v, --version Displays version information.
-d, --dependencies Display the dependencies.
-o, --output <file> Place the output into <file>
-a, --no-autoconnection Do not generate a call to
QObject::connectSlotsByName().
-p, --no-protection Disable header protection.
-n, --no-implicit-includes Disable generation of #include-directives.
-s, --no-stringliteral Deprecated. The use of this option won't take
any effect.
--postfix <postfix> Postfix to add to all generated classnames.
--tr, --translate <function> Use <function> for i18n.
--include <include-file> Add #include <include-file> to <file>.
-g, --generator <python|cpp> Select generator.
--idbased Use id based function for i18n
--from-imports Python: generate imports relative to '.'
Arguments:
[uifile] Input file (*.ui), otherwise stdin.
so now I can convert the .ui to .py by running:
uic file.ui -o file.py -g python