Improve Kdenlive Python environment
Putting these thoughts here so they're not forgotten, although I don't have time to work on it at the moment:
Kdenlive depends on multiple Python dependencies (e.g. vosk, otio, openai-whisper) but doesn't ship with its own Python interpreter. It also doesn't ship with Whisper, which is a multi-gigabyte dependency. Instead, it offers to install these missing dependencies using the user's personal Python environment. This is risky because it can break the user's own Python environment (or run into conflicts with the user's other dependencies), and it's also opaque as it's not clear to the user what is happening during installation.
It would be better for Kdenlive to create a separate Python virtualenv for itself so that the user's global Python libraries are not affected, as well as provide a way to specify the Python interpreter (for advanced users, or if there are multiple Pythons installed and the first one in $PATH is not the best option). Letting the user specify the Python interpreter also allows them to use a separate virtual environment if needed.
-
Let user choose Python path (allows user to select custom user-created Python virtualenv) -
By default, create a Python virtualenv in Kdenlive's local app directory and use that interpreter for pip install
. -
Show user the commands that will be run and the output from those commands. Whisper is multi-gigabytes, but download progress is unclear. And errors are hard to debug.