Getting back to @cb88’s original point about fragile Python environments, this comic captures the situation well:
Depending on your system, you might have a system package manager (apt-get or homebrew) that installs Python and various versions of Python libraries, and then Python based tools like pip that will install possibly conflicting versions system-wide. It can become a mess when you start using both to upgrade library versions.
And then there are “virtual environments” and virtual environment wrappers that alleviate some of the problem, but they require work to setup. Too much, in my opinion, but I don’t particularly enjoy dependency management, even if it is unavoidable.
The best way to manage paths and dependencies I’ve found so far is with pipenv and it’s Pipfiles. pipenv makes it pretty easy to track the dependencies for an individual Python program and automatically install them into a self-contained virtual environment. The best part is that the Pipfile is part of the source repository maintained by the developer, and the user just needs to run
pipenv shell to have the same build and run-time environment as the developer.
Perhaps providing Pipfiles with scripts and/or the KiCAD Python API would be helpful? I haven’t used the scripting API at all, so I don’t know.
All that said, I agree that Python is a fine choice for the KiCAD scripting language. I just wanted to acknowledge the original point that dependency hell is no fun. You just can’t avoid it.