Community
Maya Forum
Welcome to Autodesk’s Maya Forums. Share your knowledge, ask questions, and explore popular Maya topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Error 'function' object has no attribute 'isMapping' when call pymel.core in pmcmds.py

0 REPLIES 0
Reply
Message 1 of 1
hansyuan.yang
355 Views, 0 Replies

Error 'function' object has no attribute 'isMapping' when call pymel.core in pmcmds.py

When I simply run the following code in Maya script panel:

 

 

import pymel.core as pm
s = pymel.core.sphere()

 

 

or

 

 

import pymel.core as pm
win_name = "MyTest"

if pm.window(win_name, q=1, ex=1):
    pm.deleteUI(win_name)

with pm.window(win_name):
    pm.showWindow()

 

 

I got error:

# Error: AttributeError: file C:\Program Files\Autodesk\Maya2020\Python\lib\site-packages\pymel\internal\pmcmds.py line 88: 'function' object has no attribute 'isMapping' #

 

Following the error, I found line 88 in pmcmds.py :

 

 

    if maintainDicts and util.isMapping(args):
        newargs = dict(args)
        argIterable = args.iteritems()
        isList = False

 

 

And if I print type(util), the result is function, not module? At the beginning of pmcmds.py is:

 

 

import pymel.util as util

 

 

So I think the for some reason, util's type is changed from module to function and result in the error. If I manually import pymel.util again with another variable and use it in pmcmds.py, Maya's code will run ok.

How can I fix this? I reinstall Maya completely but still not working. Thank you.

Labels (1)
0 REPLIES 0

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report