In case this happens to anyone else, I eventually tracked down the problem to being a python plugin that was importing pymel. I don't remember reading that this was a problem (which it only was in batch mode) and maybe it has something to do with the rest of our setup but removing all pymel from plugins got everything working again.
On Aug 6, 2:18 pm, "[email protected]" <[email protected]> wrote: > For some reason, after months of everything being fine, pymel > mysteriously is broken in command line mode for me. > > "mayaBatch -prompt", will give the following results: > > mel: python "import pymel" > Error: line 1: 'module' object has no attribute 'util' > # Traceback (most recent call last): > # File "<maya console>", line 1, in <module> > # File "R:\Tools\Maya\3rdParty\scripts\pymel-0.9.3\pymel > \__init__.py", line 1490, in <module> > # import core.factories as factories > # File "R:\Tools\Maya\3rdParty\scripts\pymel-0.9.3\pymel\core > \__init__.py", line 5, in <module> > # from general import * > # File "R:\Tools\Maya\3rdParty\scripts\pymel-0.9.3\pymel\core > \general.py", line 21, in <module> > # import pymel.util as util > # AttributeError: 'module' object has no attribute 'util' > > Some stats: > Vista (64bit but using the 32bit version of Maya because of other > plugins) > Maya2008 > Pymel 0.9.3 > > I have also tried using mayapy, which is able to import pymel, but my > other scripts aren't able to load pymel; it is very confusing. > > To make it even more confusing, in Jan of this year (2010) we upgraded > from 0.7.8 to 0.9.2 and everything continued to work till a few weeks > ago some machines stopped while others continued just fine till now. > Something happened and no machine can run in batch mode now. > > I put together a fresh machine a couple weeks ago and found that it > was unable to run in batch while my main dev machine continued to be > able to run in batch. All the maya scripts and such are in source > control so I synced back till I had the fresh machine running in batch > mode. I then crept up till it couldn't run and found that magic > moment was when we finally upgraded pymel in Jan. This means that my > dev machine was able to function mysteriously for over 7 months. > > In all of this, the regular Maya version has worked, and continues to > work perfectly. > > The last notable bit of strangeness is that sys.modules HAS pymel.util > (and others) so I can do this: > > python "sys.modules['pymel.util'].capitalize('wtf')" > Result: Wtf > > But I can't do 'python "import pymel"' or any variant of that. > > Has anyone seen anything like this or have any ideas on how to figure > out what is going on? -- http://groups.google.com/group/python_inside_maya
