Closed hannesdelbeke closed 2 years ago
Thanks for this.
What makes me hesitant, is that we can't be sure what else is on sys.path
that may interfere with QML. It'd run within its own Python interpreter, possibly (most likely) of a different version (possibly of differing 32 or 64-bit flavour) that may or may not jive well with everything that's on there. It would be a problem very hard to debug, and on-top of that it would fall outside of what a user could do to solve it. They couldn't manually remove things from their own sys.path
.
So preferably, we would find PySide2 or PyQt5 within sys.path
and add only that.. But that still means it'll pick up Maya's own internal PySide2 version, which again may not jive with whichever Python is currently running QML.
So, I'm unsure. What are your thoughts? 🤔
True, if we pass sys path it'll crash when there are incompatible modules passed cross python version since we run 2 different python versions
However, if we dont pass sys path, the QML module cant be imported if it's in the sys.path and we run only 1 version of python.
since it sounds like this PR introduces the above issue it'll need rethinking.
the issue here is that QML does some env management for you and it mostly works but not always we now try to make it work for more cases, but might then introduce new issues.
The situation i tried to solve is slightly different, more a case of single env. if don;t have python on your pc & only use whatever build in version. you'll never be able to launch QML unless you add it to your env path. since qml only knows about modules in your env path, the qml module won't be detected because it lives in the sys path. which doesn't get passed.
The design intent is for QML to have its own dedicated Python, where QML is already installed into its own site-packages. A separate, completely independent Python typically located on the network which is only ever capable and meant to be run with Pyblish QML. In that case, you don't need any variables, just set the path to that executable and it'll know where to find QML.
Anything else is an optimisation for 50 mb of disk space and increases the complexity of your setup.
yes maybe QML is just not the right solution then for what i'm doing. I treat it more as a fancy UI but use it the same way as pyblish lite. if we want to use it we cant ever assume the user has python installed so need to limit to maya's or blender's python
this PR adds support to the QML server working in certain isolated environments without having to do any additional custom env management
follow up from the gitter discussion:
Hannes @hannesdelbeke
Marcus Ottosson @mottosso May 20 06:44
Hannes @hannesdelbeke May 20 10:24