pyblish / pyblish-starter

A basic asset creation pipeline - batteries included. http://pyblish.com/pyblish-starter
MIT License
17 stars 9 forks source link

Problems getting started #8

Closed sschoellhammer closed 6 years ago

sschoellhammer commented 7 years ago

Hello I'm trying pyblish for the first time and got problems getting it to run

Here's what I do, following https://github.com/pyblish/pyblish-maya#usage:

import sys
sys.path.append("D:/code/Pyblish/pyblish-starter")
sys.path.append("D:/code/Pyblish/pyblish-base")
sys.path.append("D:/code/Pyblish/pyblish-maya")

import pyblish.api
pyblish.api.register_gui("pyblish_lite")

import pyblish_maya
pyblish_maya.setup()

All good so far

from pyblish_starter import api, maya
api.install(maya)
>>
# Error: AttributeError: file <maya console> line 2: 'module' object has no attribute 'install' # 

import pyblish_maya
pyblish_maya.show()
>>
# Error: TypeError: file D:/code/Pyblish/pyblish-maya\pyblish_maya\lib.py line 67: _show_no_gui() takes no arguments (1 given) # 

Now that I write this, I realize that I didn't not do pip install but just reference the repo's directly adding them to my path. Could that be the reason?

Thanks for having a look! seb

mottosso commented 7 years ago

Hi @sschoellhammer, sorry to hear you're having trouble!

from pyblish_starter import api, maya
api.install(maya)

I spotted an error in the README here, it should be pyblish_starter.install(). I'll add install to api as that's where it should be.

import pyblish_maya
pyblish_maya.show()

This looks like another bug, how embarrassing! Till I see it fixed, you can also pyblish_qml.show() or pyblish_lite.show(), or use the File -> Publish menu item with Pyblish Maya installed.

Let me know how that works out.

sschoellhammer commented 7 years ago

Hi @mottosso ! Sorry for getting back so late - I'm back on the case. When I do:

import pyblish_qml pyblish_qml.show()

I get this loading icon but nothing happens: image

What else am I doing wrong? :)

mottosso commented 7 years ago

Haha, luck is not on your side!

Try adding the path to pyblish_qml to your PYTHONPATH.

For example

# UNTESTED
import os
os.environ["PYTHONPATH"] += ";" + os.path.dirname(pyblish_qml.__file__)

pyblish_qml.show()

Pyblish QML is meant to be available on your PYTHONPATH when starting Maya, that's what would normally happen when you pip install. I can only assume you've added it by hand, after starting Maya via sys.path which is OK, but moves some of the responsibility onto you, such as this.

sschoellhammer commented 7 years ago

Ok that one didn't work for me :P So now I did pip install pyblish_qml (and the other packages) and I can successfully run the qml demo (from the command line) Looks very cool :) Should that also just work out of the box in maya now? I see it's installing into my python installation i.e. C:/python2.7 but with maya using it's own interpreter, that wouldn't work?

mottosso commented 7 years ago

I think we better have some one on one so I can get a sense of what's going on. What are your plans this weekend, and do you have some means to chat, like Skype of Hangouts? :)

mottosso commented 7 years ago

Hey @sschoellhammer,

Just checking in on how things are going. Did you manage to solve your issue? If not, could you confirm whether you were able to run..

from pyblish import util
util.publish()

..either from inside or outside of Maya?

From there, could you confirm whether you got a GUI, either QML or Lite, showing from within Maya?

from pyblish_qml
pyblish_qml.show()

And finally, Pyblish Starter? I've updated the installation instructions and Starter to automatically install Pyblish Maya upon installing Starter.

Full installation instructions here.

Note that pip installs to the current working directory, which is then added to your PYTHONPATH prior to launching Maya.

pip install pyblish-starter --target .

You can do the same for QML.

pip install pyblish-qml --target .

You can add it to PYTHONPATH however you need, just make sure it's there prior to launching Maya, rather than adding it retrospectively from within Maya.

mottosso commented 6 years ago

Let me know if there's still a problem!