Pyblish Shell on OSX

solved

#1

Hey,
I’m trying to run pyblish_qml with maya, and understood the best way would be using pyblish_shell (correct?)

(Running on OSX Sierra)
from terminal:
export PYTHONPATH=$PYTHONPATH:/path/to/pyblish_qml
pyblish_shell -m pyblish_qml “$@”

Getting me to here:
Traceback (most recent call last):
File “/Library/Python/2.7/site-packages/cx_Freeze/initscripts/Console.py”, line 27, in
File “pyblish_shell.py”, line 77, in
File “/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py”, line 176, in run_module
fname, loader, pkg_name)
File “/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py”, line 82, in _run_module_code
mod_name, mod_fname, mod_loader, pkg_name)
File “/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py”, line 72, in _run_code
exec code in run_globals
File “/Users/liorbenhorin/Documents/Projects/2016/GitHub/pyblish-qml/pyblish_qml/main.py”, line 6, in
from . import app
File “/Users/liorbenhorin/Documents/Projects/2016/GitHub/pyblish-qml/pyblish_qml/app.py”, line 12, in
from PyQt5 import QtCore, QtGui, QtQuick, QtTest
File “ExtensionLoader_PyQt5_QtCore.py”, line 22, in
File “ExtensionLoader_PyQt5_QtCore.py”, line 14, in bootstrap
ImportError: dlopen(/Users/liorbenhorin/Documents/Projects/2016/GitHub/pyblish-shell-1.1.3-build80-osx-x64/PyQt5.QtCore.so, 2): Library not loaded: ./QtCore
Referenced from: /Users/liorbenhorin/Documents/Projects/2016/GitHub/pyblish-shell-1.1.3-build80-osx-x64/PyQt5.QtCore.so
Reason: image not found
liors-MacBook-Pro:~ liorbenhorin$ /Users/liorbenhorin/Documents/Projects/2016/GitHub/pyblish-shell-1.1.3-build80-osx-x64/pyblish_shell -m pyblish_qml
Traceback (most recent call last):
File “/Library/Python/2.7/site-packages/cx_Freeze/initscripts/Console.py”, line 27, in
File “pyblish_shell.py”, line 77, in
File “/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py”, line 176, in run_module
fname, loader, pkg_name)
File “/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py”, line 82, in _run_module_code
mod_name, mod_fname, mod_loader, pkg_name)
File “/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py”, line 72, in _run_code
exec code in run_globals
File “/Users/liorbenhorin/Documents/Projects/2016/GitHub/pyblish-qml/pyblish_qml/main.py”, line 6, in
from . import app
File “/Users/liorbenhorin/Documents/Projects/2016/GitHub/pyblish-qml/pyblish_qml/app.py”, line 12, in
from PyQt5 import QtCore, QtGui, QtQuick, QtTest
File “ExtensionLoader_PyQt5_QtCore.py”, line 22, in
File “ExtensionLoader_PyQt5_QtCore.py”, line 14, in bootstrap
ImportError: dlopen(/Users/liorbenhorin/Documents/Projects/2016/GitHub/pyblish-shell-1.1.3-build80-osx-x64/PyQt5.QtCore.so, 2): Library not loaded: ./QtCore
Referenced from: /Users/liorbenhorin/Documents/Projects/2016/GitHub/pyblish-shell-1.1.3-build80-osx-x64/PyQt5.QtCore.so
Reason: image not found

To simplify, even when i run

pyblish_shell, and then from within the interpreter I run:

>>from PyQt5 import QtWidgets
Traceback (most recent call last):
  File "<console>", line 1, in <module>
  File "ExtensionLoader_PyQt5_QtWidgets.py", line 22, in <module>
  File "ExtensionLoader_PyQt5_QtWidgets.py", line 14, in __bootstrap__
ImportError: dlopen(/Users/liorbenhorin/Documents/Projects/2016/GitHub/pyblish-shell-1.1.3-build80-osx-x64/PyQt5.QtWidgets.so, 2): Library not loaded: ./QtWidgets
  Referenced from: /Users/liorbenhorin/Documents/Projects/2016/GitHub/pyblish-shell-1.1.3-build80-osx-x64/PyQt5.QtWidgets.so
  Reason: image not found

Sorry for the long paths, I’m was just running a dirty test but couldn’t get far :slight_smile:
Any help appreciated!


#2

Hi Lior!

Actually no, pyblish_shell has been discontinued. I’ll update the project to make a note of this, would you mind sharing from where you learnt about it and when to use it? I’d like to update those sources as well to avoid further confusion.


#3

Thanks for clarifying!

Actually I was getting this from few sources:

From within the release zip


Looked inside the *.bat file

That was the base and from there i was improvising…

The make this more interesting, I was trying this this morning on Windows station,
After few attempts I tried this inside Maya (got this from pyblish_qml readme)

from pyblish_qml import api, show

# Tell QML about dependencies
api.register_python_executable("C:/Python27/python.exe")
api.register_pyqt5("C:/modules/python-qt5")

show()

Pointed publish_qml to pyblish_shell’s interperter and qt5 dir,
I got the UI to show! But it is coming up empty :confused:
Tested out few times but kept getting empty GUI.
If that helps, the collection plugins did fire (saw their logs)
Im away from my computer now so no screengrabs and outputs.

Anyways,
What would be the current standard workflow to get pyblish_qml running with pyblish on maya windows/mac?

p.s
For now I’m using lite and its working great.


#4

The workflow has been through a few iterations, that’s why there are a few outdated versions of how to get up and running. Your safest bet is to see the documentation for pyblish-qml.

In short, it’s this.

Step 1

Install, and test the installation. This will make sure everything is in tip top shape, before heading into Maya land. You’ll need PyQt5, and the simplest way of getting it is by installing it for Python 3.

$ pip install PyQt5 pyblish-qml
$ python -m pyblish_qml --demo

Make sure this is working, before moving onto the next step.

Step 2

Now you’ll need to install it for Maya as well. The simplest way to do that, is to pip install in any directory, and adding this directory to the Maya PYTHONPATH.

$ pip install pyblish-qml --target c:\some\directory
$ set PYTHONPATH=c:\some\directory
$ "c:\program files\autodesk\maya2018\bin\maya.exe"

Inside Maya, call pyblish_qml.show() and you’ll be on your way.

For production, I’d suggest you install both PyQt5 and pyblish-qml into a common directory, like on your network, and add them to your PYTHONPATH.

Let me know how it goes.


#5

Sorry, I noticed you were on OSX.

The principle is the same, just a few differing names.

Step 2

$ pip install pyblish-qml --target /some/directory
$ export PYTHONPATH=/some/directory
$ maya

#6

Sounds good - I will try it as soon as I’ll be home and update here

Thanks!


#7

Here’s the update - got it to run just like you said, but, getting this on step 1

Same traceback i get when running step 2 from maya, and also with pyblish_maya (just with different plugins…)

~

I assume this is a minor thing you will point me to,
so i will just ask few production deployment questions to make sure I got it right:

Every station will need python 3?
For apps we have that require python27, we will have to set PYTHON_HOME and PATH prior to their load, correct?

Should I’ll be pip installing PyQt5 and pyblish_qml with --target to the network drive?
Why do I need two installs of pyblish_qml - can’t I point Maya to the same install?

Thanks a lot for helping me get this running, it’s very much appreciated!


#8

For this, it looks like you’ve run into a backwards compatibility issue with the latest release of Pyblish QML.

Try downgrading to 1.3.1.

$ pip install -U pyblish-qml==1.3.1

On the station where you want to run Pyblish QML, you’ll need the PyQt5 binaries and if you’re using Python 3 to run those binaries, then the workstation will require access to it as well.

What is typically done is putting Python 3 on the server, along with PyQt5, such that you can call e.g. /your/server/python3/python -m pyblish_qml -- demo. That way you could get away with only installing it once. But having it on every workstation is recommended for best start-up performance.

You can, and should, use the same. It was easier for me to show you how to do it separately, and makes it a little easier to understand what’s going on. Once you’ve got it running, I’d recommend installing it once, and exposing it to both Python 3 and your Maya.

The important thing to realise is don’t expose site-packages of your Python install to Maya.

Install it with --target in an isolated location. Pyblish QML will work fine, but doing so in general is bad and may cause difficult to debug errors, when Maya is attempting to use modules from Python 3 when it shouldn’t, like os or sys. The same goes for if you are using Python 2.


#9

Understood! Everything is very clear now and I got it to work.
Next step will be deploying on the network, I will let you know how it goes.


#10

If you are feeling adventurous, there is one recent thing you could try to avoid having Python 3 on all of your workstations, which only applies if you are using Maya 2017 and up.

What you can do is (1) compile PyQt5 for Maya 2017 and (2) call pyblish-qml using mayapy.

Maya 2017 and up are using Qt 5, which will enable use of PyQt5. I haven’t tested it, but I see no reason why it shouldn’t work. Down the line, my intent is to enable use of pyblish-qml directly from within Maya, which will then also have access to QML directly.


#11

Actually compiling PyQt5 does sound’s adventurous for me at the moment :wink: