We’ve started taking a look, but run into issues with Pyblish setting the PYTHONPATH environment var.
We’re currently using Maya.env to set version specific vars for our tools.
Any paths set to PYTHONPATH in the Maya.env appear to be ignored (including after appending %PYTHONPATH% to either).
Do you mean Pyblish is setting/altering the PYTHONPATH for you? Or that you when you add Pyblish to your PYTHONPATH, it isn’t getting picked up?
To add Pyblish, we first need to figure out which install you are running. If you are using the recommended distribution for your platform, which seem to be Windows (looking att he % symbols) and should be Pyblish for Windows then you should find a /pythonpath subdirectory within that install which is what you are meant to add to your PYTHONPATH.
Try this, from a console on Windows.
$ set PYTHONPATH=c:\path\to\pyblish-win\pythonpath
$ set PYTHONPATH=c:\path\to\pyblish-win\lib\pyblish-x\integrations\maya;%PYTHONPATH%
$ c:\program files\autodesk\maya2016\bin\maya.exe
This will replace anything you currently have on your PYTHONPATH temporarily, and launch Maya with its Pyblish integration.
Within Maya, try importing Pyblish.
import pyblish
If that works, have a look in your file-menu for a new “Publish” option.
Thanks Marcus and apologies, I shouldn’t be writing posts when I’m half asleep.
I am running the windows installer, Pyblish is editing my PYTHONPATH and is indeed working.
My problem is that now my Maya.env doesn’t affect PYTHONPATH and our tools no longer work.
The paths set in Maya.env only appear to work once I’ve completely removed the PYTHONPATH environment variable from windows.
I could add Pyblish to the Maya.env, however I’d rather find away for both to work to reduce any potential changes to our current structure.
I was wondering if anyone has encountered clashes like this before?
The installer will modify your local PYTHONPATH for your currently logged on user, Maya.env must not be liking that very much and I haven’t heard of anyone else having this problem.
But it is perfectly safe to remove Pyblish from that path, and add it however you like.
If Pyblish is the only variable in that PYTHONPATH, then it sounds like Maya would be the happiest by you removing it altogether.
The upper portion of this GUI is your local variables.
Studio Install
However, since it sounds like you are running Pyblish within a studio, then there is an alternative method of installation that is recommended, which is this right here.
The difference here is that environment variables are left for you to handle, and that you can install it to a custom location, such as on a shared server. The installer is primarily for first-contact and getting familiar with Pyblish at home.
Are you append to the PYTHONPATH? Heres a .mod file from arnold, which I’m guessing is using the same syntax as the .env file, where it appends to the PATH environment variable:
Sorry, but did you say that when you remove Pyblish from your PYTHONPATH, the Maya.env would start working normally again? Or was it after the installation that suddenly it stopped working, regardless of what you do?
Thanks @tokejepsen, I’ll give it a go.
I know its an issue with Maya.env, NOT Pyblish - apologies I should’ve made that clear.
The topic was to find out if anyone here has experienced this issue and if so how to resolve.
No worries, @ldunham1, we’re happy to help regardless. =) Sorry though, I haven’t used Maya.env enough to know for sure what’s going on. Maybe @tokejepsen has some more ideas.
Just here to confirm that indeed setting PYTHONPATH as an environment variable will override Maya.env loading it correctly. I’m not sure why, but it’s really inconvenient.
It’s the same if the PYTHONPATH being set is just “appending” to whatever exists. I’m not sure what happens when you actually set the environment variable to %PYTHONPATH%;pyblish/path. Though using set or setx would actually store the %PYTHONPATH% as an expanded variable so that wouldn’t set it like that either.