No module named pyblish_qml
Receiving the error "No module named pyblish_qml" when attempting to exec pyblish_maya.show() under maya 2018.
executing:
import pyblish_qml, pyblish, pyblish_maya
from pyblish_qml import api
sys.path.append(r'G:\_PIPELINE_MANAGEMENT\_externalPythonLibraries\pyblish_maya\pythonpath')
pyblish.api.register_gui("pyblish_qml")
api.register_python_executable("C:/Python27/python.exe")
api.register_pyqt5(r'G:\_PIPELINE_MANAGEMENT\_externalPythonLibraries\PyQt5')
pyblish_maya.setup()
pyblish_maya.show()
result:
pyblish: Deregistered g:/_PIPELINE_MANAGEMENT/_externalPythonLibraries\pyblish_maya\plugins
pyblish: Integration torn down successfully
pyblish: Registered g:/_PIPELINE_MANAGEMENT/_externalPythonLibraries\pyblish_maya\plugins
Pyblish loaded successfully.
Setting up Pyblish QML in Maya
Using Python @ 'C:/Python27/python.exe'
Using PyQt5 @ 'G:\_PIPELINE_MANAGEMENT\_externalPythonLibraries\PyQt5'
Targets: default
Success. QML server available as pyblish_qml.api.current_server()
C:\Python27\python.exe: No module named pyblish_qml
Make sure pyblish_qml is on your PYTHONPATH environment variable, that's the one getting passed to your Python executable (not sys.path, which is only used by Maya).
import os
...
os.environ["PYTHONPATH"] += os.pathsep + os.sep.join(pyblish_qml.__file__.rsplit(os.sep)[:-2])
...
pyblish_maya.show()
If you know where pyblish_qml is, best to add the path directly instead of the .rsplit mess above.
These can also be added to your environment prior to launching Maya.
# On Windows
$ set PATH=%PATH%;c:\python27
$ set PYTHONPATH=c:\pythonpath
$ maya
Let me know if this works for you.
This fixes the original issue, though I am receiving a dialog stating
"This application failed to start because it could not find or locate the Qt platform plugin "Windows" in "".
Make sure your PyQt5 installation works with that Python version.
- https://github.com/pyqt/python-qt5#testing-out-the-installation
Thanks. Getting closer..
I am getting yet another error though:
Setting up Pyblish QML in Maya
Using Python @ 'C:/python27/python.exe'
Using PyQt5 @ 'C:\Python27\Lib\site-packages\PyQt5'
Targets: default
Success. QML server available as pyblish_qml.api.current_server()
Starting pyblish-qml
Done, don't forget to call `show()`
HiddenSections = [u'Collect']
ContextLabel = Maya
WindowSize = [430, 600]
WindowPosition = [100, 100]
WindowTitle = Pyblish (Maya)
HeartbeatInterval = 60
Settings:
Entering state: "alive"
Entering state: "clean"
Entering state: "ready"
Entering state: "hidden"
Entering state: "visible"
file:///g:/_PIPELINE_MANAGEMENT/_externalPythonLibraries/pyblish_qml/qml/app.qml:9:1: module "QtQuick.Controls" version 1.3 is not installed
I have followed the advice/instructions here but havent been able to resolve the issue. https://github.com/pyblish/pyblish-qml/issues/215
executing:
sys.path.append(r'G:\_PIPELINE_MANAGEMENT\_externalPythonLibraries\pyblish_maya\pythonpath')
os.environ["PYTHONPATH"] += os.pathsep + os.sep.join(pyblish_qml.__file__.rsplit(os.sep)[:-2])
os.environ["QML2_IMPORT_PATH"] = 'C:/Python27/Lib/site-packages/PyQt5/qml'
pyblish.api.register_gui("pyblish_qml")
api.register_python_executable("C:/python27/python.exe")
api.register_pyqt5(r'C:\Python27\Lib\site-packages\PyQt5')
pyblish_maya.setup()
Thanks for sharing what you tried, but which advice did you follow exactly? Installing via pip3 or installing via Git?
It looks like your version of PyQt5 is too old; this should work.
Using the git install resolves the issue within pyblish_maya, but stops my pyblish_nuke from working.. Perhaps I need to be using separate PyQt installs for different versions.