Problem importing pyblish_maya and need to add 'maya' as host

Hello,

I’ve just started testing pyblish in maya 2022. Importing pyblish_qml works in maya, however when I try to import pyblish_maya I get the following error regarding a missing module called “version”? When I looked up this error online, it seems to indicate that this is due to python 2 and 3 working differently. Is it possible that pyblish_maya does not work with python 3?

import pyblish_maya
Error: No module named 'version'
Traceback (most recent call last):
File "<maya console>", line 1, in <module>
File "/usr/autodesk/maya2022/lib/python3.7/site-packages/shiboken2/files.dir/shibokensupport/__feature__.py", line 142, in _import
return original_import(name, *args, **kwargs)
File "/nwave/data/users/fernandos/pyblish_test/Pyblish_Python3.8/pyblish-maya/pyblish_maya/__init__.py", line 1, in <module>
from version import *
File "/usr/autodesk/maya2022/lib/python3.7/site-packages/shiboken2/files.dir/shibokensupport/__feature__.py", line 142, in _import
return original_import(name, *args, **kwargs)
ModuleNotFoundError: No module named 'version' # 

On a different issue, I was playing around with a simple plugin that imports maya cmds, so I used
hosts=['maya']
in the plugin. But it does not seem to register automatically unless I also add the line:
pyblish.api.register_host("maya")
while this is not problematic per se, I thought maya was a host that was already known by pyblish?

My apologies if these questions are really basic, I just started using pyblish two days ago.

Kind regards,
Fernando

Those are two separate concepts, whereby Pyblish only runs plug-ins with a matching host. E.g. if your plug-in is host="maya" but your registered host is houdini, that plug-in will not be run.

See the API docs for details.

Try using QML without pyblish_maya. It’s out of date and not necessary beyond the file menu item, which you can add yourself like this.

Ps: Welcome to Pyblish @fernandos :slight_smile:

Hi Marcus,

Thanks for the swift reply!
Good to know pyblish_maya isn’t really necessary.

Cheers,
Fernando