Maya 2022.3 crashing shortly after importing PyMEL

Maya 2022.3 crashing shortly after importing PyMEL

triffski
Advocate Advocate
2,308 Views
6 Replies
Message 1 of 7

Maya 2022.3 crashing shortly after importing PyMEL

triffski
Advocate
Advocate

I've had a crash occurring for a few weeks now with a module I'm working on but I've struggled to even get any pointers towards what's causing it. My best guess was something Qt related, but it's looking like that was wrong. 

 

Tonight I was working on a much simpler script with no UI and had what felt like exactly the same crash, after just this:

import pymel.core as pm

I then repro'd it around five times, each one inside a couple of minutes. There's no error message and I can't find anything in any logs - just a freeze for a few seconds and *POP*, it's gone. Usually there's an autosave, but not always.

 

I've attached the crash dump in case it's any use - my temp folder tells me I've had 67 of these crashes in the past week, and that's whilst avoiding doing any scripting out of pure frustration 🙂 Oh, and a long weekend.

 

I have a VM installed with vanilla Maya for testing, so I tried the same over there and so far it hasn't crashed. With nothing else to go off, I've compared the logs after importing pymel on both machines and there are some differences.

 

My main PC:

# Warning: pymel : found new MPx classes: MPxTransformPreRotation. Run pymel.api.plugins._suggestNewMPxValues() # 
# pymel.core : Updating pymel with pre-loaded plugins: mayaHIK, invertShape, curveWarp, hairPhysicalShader, ATFPlugin, ikSpringSolver, retargeterNodes, sweep, lookdevKit, Type, Boss, bifrostGraph, meshReorder, modelingToolkit, MayaMuscle, MayaScanner, dx11Shader, matrixNodes, deformerEvaluator, shaderFXPlugin, bullet, objExport, ufeSupport, GPUBuiltInDeformer, mayaVnnPlugin, stereoCamera, svgFileTranslator, GamePipeline, tiffFloatReader, MASH, poseInterpolator, cacheEvaluator, ik2Bsolver, xgenToolkit, AbcExport, gameFbxExporter, VectorRender, OpenEXRLoader, Unfold3D, mayaCharacterization, mtoa, rotateHelper, AbcImport, autoLoader, sceneAssembly, gpuCache, PolyTools, gameVertexCount, mayaUsdPlugin, OneClick, MayaScannerCB, renderSetup, ArubaTessellator, quatNodes, fbxmaya # 

Vanilla Maya on the VM is missing these from its list - so I'm wondering if one of them is the culprit or if it's something else entirely:

Boss, MayaScanner, bullet, mayaVnnPlugin, stereoCamera, VectorRender, PolyTools, gameVertexCount, MayaScannerCB

There is a pymel.log on my machine and I can see the file modified date is being updated when I run Maya, but it's 0 bytes (why is this?!). I don't have an ADN subscription, so I don't have symbols.

 

I'm going to try disabling everything I'm able to on my main PC, but beyond that I'm out of ideas. I could do a clean reinstall but I'm still pretty new to Maya scripting and really don't want to have to set everything up again (even if I had the time and could remember it all!).

 

If anyone has any suggestions then I'd be eternally grateful, 'cos I'm fully out of ideas!


0 Likes
Accepted solutions (1)
2,309 Views
6 Replies
Replies (6)
Message 2 of 7

warnold2
Autodesk
Autodesk

I'll go over the crash a bit more to see if I can find anything similar.

in the meantime if you don't need/use the autoloader plugin, you can turn off its autoload setting in the Plugin Manager.

 

this is the plugin that checks the Autodesk App Store for new plugins update.   in most cases one would not need it to be running all of the time.

 

at some point, Maya is getting a null pointer for a directory scan.

 



Wayne Arnold

Developer

Message 3 of 7

triffski
Advocate
Advocate

Thanks, I’ll give it a look. I only started looking over plugins because I literally had nothing else to go off.

0 Likes
Message 4 of 7

zewt
Collaborator
Collaborator

You could try running Process Monitor (https://docs.microsoft.com/en-us/sysinternals/downloads/procmon) to see what Maya's looking at when it happens, which might give a clue.

Message 5 of 7

triffski
Advocate
Advocate

Thanks for the suggestion @zewt - good old sysinternals 🙂 I'll give this a shot.

 

That aside, I was just checking over the PyMEL installation and noticed this - which looks to me like it's borked:

 

C:\Program Files\Autodesk\Maya2022\bin>mayapy -m pip install "pymel>=1.2.,<1.3."
Traceback (most recent call last):
File "C:\Program Files\Autodesk\Maya2022\Python37\lib\runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "C:\Program Files\Autodesk\Maya2022\Python37\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:\Program Files\Autodesk\Maya2022\Python37\lib\site-packages\pip\__main__.py", line 23, in <module>
from pip._internal.cli.main import main as _main # isort:skip # noqa
File "C:\Program Files\Autodesk\Maya2022\Python37\lib\site-packages\pip\_internal\cli\main.py", line 10, in <module>
from pip._internal.cli.autocompletion import autocomplete
File "C:\Program Files\Autodesk\Maya2022\Python37\lib\site-packages\pip\_internal\cli\autocompletion.py", line 9, in <module>
from pip._internal.cli.main_parser import create_main_parser
File "C:\Program Files\Autodesk\Maya2022\Python37\lib\site-packages\pip\_internal\cli\main_parser.py", line 7, in <module>
from pip._internal.cli import cmdoptions
File "C:\Program Files\Autodesk\Maya2022\Python37\lib\site-packages\pip\_internal\cli\cmdoptions.py", line 23, in <module>
from pip._internal.cli.progress_bars import BAR_TYPES
File "C:\Program Files\Autodesk\Maya2022\Python37\lib\site-packages\pip\_internal\cli\progress_bars.py", line 12, in <module>
from pip._internal.utils.logging import get_indentation
File "C:\Program Files\Autodesk\Maya2022\Python37\lib\site-packages\pip\_internal\utils\logging.py", line 18, in <module>
from pip._internal.utils.misc import ensure_dir
File "C:\Program Files\Autodesk\Maya2022\Python37\lib\site-packages\pip\_internal\utils\misc.py", line 33, in <module>
from pip._internal.locations import (
File "C:\Program Files\Autodesk\Maya2022\Python37\lib\site-packages\pip\_internal\locations\__init__.py", line 14, in <module>
from . import _distutils, _sysconfig
File "C:\Program Files\Autodesk\Maya2022\Python37\lib\site-packages\pip\_internal\locations\_sysconfig.py", line 8, in <module>
from pip._internal.exceptions import InvalidSchemeCombination, UserInstallationInvalid
ImportError: cannot import name 'InvalidSchemeCombination' from 'pip._internal.exceptions' (C:\Program Files\Autodesk\Maya2022\Python37\lib\site-packages\pip\_internal\exceptions.py)

0 Likes
Message 6 of 7

triffski
Advocate
Advocate

So, I copied the Maya2022/Python37 folder from a clean install and replaced my ver, which didn't error and allowed me to check and then upgrade PyMEL. It's now also in my path.

C:\Program Files\Autodesk\Maya2022\bin>mayapy -m pip install "pymel>=1.2.,<1.3."
Requirement already satisfied: pymel<1.3.,>=1.2. in c:\program files\autodesk\maya2022\python37\lib\site-packages (1.2.0)
Requirement already satisfied: future>=0.18 in c:\program files\autodesk\maya2022\python37\lib\site-packages (from pymel<1.3.,>=1.2.) (0.18.2)
WARNING: You are using pip version 20.2.2; however, version 22.0.4 is available.
You should consider upgrading via the 'C:\Program Files\Autodesk\Maya2022\bin\mayapy.exe -m pip install --upgrade pip' command.

C:\Program Files\Autodesk\Maya2022\bin>mayapy.exe -m pip install --upgrade pip
Collecting pip
  Downloading pip-22.0.4-py3-none-any.whl (2.1 MB)
     |████████████████████████████████| 2.1 MB 6.4 MB/s
Installing collected packages: pip
  Attempting uninstall: pip
    Found existing installation: pip 20.2.2
    Uninstalling pip-20.2.2:
      Successfully uninstalled pip-20.2.2
  WARNING: The scripts pip.exe, pip3.7.exe and pip3.exe are installed in 'C:\Program Files\Autodesk\Maya2022\Python37\Scripts' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed pip-22.0.4

Restarted Maya, all good. Imported PyMEL and it immediately crashed, which I reported:

Thank you for sending your error report 323294151 to Autodesk.

Is there anything you can see from that please, @warnold2 ?

0 Likes
Message 7 of 7

triffski
Advocate
Advocate
Accepted solution

I've been working for a couple of hours now with no crashes (and probably tempting fate by typing this!), here's what I ended up doing in case it's useful to anyone:

 

1: Replaced my local C:\Program Files\Autodesk\Maya2022\Python37 folder with a copy from a clean install of 2022.3

2: In an elevated cmd prompt, switched to C:\Program Files\Autodesk\Maya2022\bin and did a: mayapy -m pip list

3: Updated each package with mayapy.exe -m pip install --upgrade and the package name

4: Added C:\Program Files\Autodesk\Maya2022\Python37\Scripts to my path, because mayapy was moaning about it :]

 

So it looks like my Python37 folder got corrupted somehow, as mentioned in message 5 above.

 

Fingers are hard crossed! Thanks for your input, will return optimistically if I run into the same issue again.

 

 

0 Likes