I was having trouble in the pyblish_qml + pyblish_maya setup.
In order to get the GUI show up, I have to set up all the dependencies of PyQt5 into env var like this
import os
import sys
import pyblish.api
pyblish.api.register_gui("pyblish_qml")
# Add to Maya
sys.path.insert(0, r"~\packages\pyblish_qml\1.11.5\python-3.7\python")
sys.path.insert(0, r"~\packages\pyblish_base\1.8.8\python-3.7\python")
sys.path.insert(0, r"~\packages\pyblish_maya\2.1.8\python-3.7\python")
sys.path.insert(0, r"~\packages\PyQt5_sip\12.9.0\platform-windows\arch-AMD64\python-3.7\python")
sys.path.insert(0, r"~\packages\PyQt5_Qt5\5.15.2\platform-windows\arch-AMD64\python-3.7\python")
sys.path.insert(0, r"~\packages\PySide2\5.15.2\platform-windows\arch-AMD64\python-3.7\python")
# Add to Pyblish QML
os.environ["PYTHONPATH"] = r"~\packages\pyblish_qml\1.11.5\python-3.7\python"
os.environ["PYTHONPATH"] += r";~\packages\pyblish_base\1.8.8\python-3.7\python"
os.environ["PYTHONPATH"] += r";~\packages\pyblish_maya\2.1.8\python-3.7\python"
os.environ["PYTHONPATH"] += r";~\packages\PySide2\5.15.2\platform-windows\arch-AMD64\python-3.7\python"
os.environ["PYTHONPATH"] += r";~\packages\PyQt5_Qt5\5.15.2\platform-windows\arch-AMD64\python-3.7\python"
os.environ["PYTHONPATH"] += r";~\packages\PyQt5_sip\12.9.0\platform-windows\arch-AMD64\python-3.7\python"
from pyblish_qml import api, show
api.register_python_executable(r"~/apps/studio/prod/python/3.7.7/platform-windows/python.exe")
api.register_pyqt5(r"~\packages\PyQt5\5.15.4\platform-windows\arch-AMD64\python-3.7\python")
import pyblish_maya
pyblish_maya.setup()
If I simply do this two
import pyblish.api
import pyblish_maya
pyblish.api.register_gui("pyblish_qml")
from pyblish_qml import api, show
api.register_python_executable(r"~/apps/studio/prod/python/3.7.7/platform-windows/python.exe")
api.register_pyqt5(r"~\packages\PyQt5\5.15.4\platform-windows\arch-AMD64\python-3.7\python")
there will be an error message saying “This application fialed to start because no Qt Platform plugin could be initialized. Reinstalling the aplication may fix this problem.”
1. Is that a normal case that I have to set up all these PyQt5_* dependencies?**
[Solved] 2. Even though I got the window pops up, the windows contains nothing.
It might be caused by the PySide2/init.py: Unable to import shiboken2 from ~\packages\pyblish_qml\1.11.5\python-3.7\python\pyblish_qml\ipc, …, But I’m not 100% sure about this.
Update 2021/07/23 17:06 : Alright that’s exactly the problem. Now I have to have two more PYTHONPATH be added to make this works.
sys.path.insert(0, r"~\packages\shiboken2\5.15.2\platform-windows\arch-AMD64\python-3.7\python")
os.environ["PYTHONPATH"] += r";~\packages\shiboken2\5.15.2\platform-windows\arch-AMD64\python-3.7\python"
[Solved] 3. Meanwhile I will have lite window working with simply these lines
import pyblish.api
pyblish.api.register_gui("pyblish_lite")
import pyblish_maya
pyblish_maya.setup()