pyblish-maya icon indicating copy to clipboard operation
pyblish-maya copied to clipboard

No module named pyblish_qml

Open adurm-sw opened this issue 7 years ago • 6 comments

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

adurm-sw avatar Jul 31 '18 06:07 adurm-sw

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.

mottosso avatar Jul 31 '18 06:07 mottosso

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 "".

adurm-sw avatar Jul 31 '18 08:07 adurm-sw

Make sure your PyQt5 installation works with that Python version.

  • https://github.com/pyqt/python-qt5#testing-out-the-installation

mottosso avatar Jul 31 '18 08:07 mottosso

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()

adurm-sw avatar Aug 01 '18 01:08 adurm-sw

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.

mottosso avatar Aug 01 '18 05:08 mottosso

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.

adurm-sw avatar Aug 03 '18 04:08 adurm-sw