Missing modules that are added at runtime

Hi there,

I am trying to create a package that can be used across multiple machines that will use pyblish, pyblish Maya and the QML ui, but without PIP installing the pyblish packages on each machine. So I have set up a local site-packages that contains all the pyblish pacakges needed and their dependencies. I pass that into the PYTHONPATH using sys.path.append which works for the setup of the tool i.e. when Maya is opened. When I try to open the publisher from the file menu in Maya these packages are no longer found as sys.path.append is session specific. This causes the tool to fail when trying to run as none of the packages are found.

I was hoping to get some insight as to where I need to declare these packages to include them when opening the pyblish UI from Maya?

Hi @otterly, welcome to Pyblish!

That does not add it to PYTHONPATH, it’s the other way around. Whatever is on your PYTHONPATH environment variable is automatically added to sys.path on startup of e.g. Maya.

So you can either (1) add your custom site-packages to PYTHONPATH before launching Maya, or (2) add it to both os.envion["PYTHONPATH"] and sys.path to ensure new processes (like Pyblish QML) gains access to it.