pymel.internal.startup : ERROR : maya.standalone was successfully initialized, but pymel failed to import maya.cmds (or it was not populated)

1,460 views
Skip to first unread message

tushar sankhala

unread,
Sep 20, 2014, 2:27:30 AM9/20/14
to python_in...@googlegroups.com
Hi All,

I was mostly developing for Maya C++ Api and i am new to Maya Python. So sorry if am wrong somewhere. I was reading and following 
Practical Maya Programming Book by Robert Galanakis

i am getting a error as soon as i import pymel.core as pmc in mayapy

Error:

pymel.internal.startup : ERROR : maya.standalone was successfully initialized, b
ut pymel failed to import maya.cmds (or it was not populated)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Program Files\Autodesk\Maya2014\Python\lib\site-packages\pymel\core\_
_init__.py", line 11, in <module>
    _startup.mayaInit()
  File "C:\Program Files\Autodesk\Maya2014\Python\lib\site-packages\pymel\intern
al\startup.py", line 170, in mayaInit
    from maya.cmds import about
ImportError: cannot import name about

Can anyone help me in this?

Thanks in advance

Tushar

Mahmoodreza Aarabi

unread,
Sep 20, 2014, 2:32:02 AM9/20/14
to python_in...@googlegroups.com

Hey

it is better you share your code snippet,but,

you can use cmds in this way first:

import maya.cmds as cmds

import pymel.core as pm

then :

cmds.about()

pm.about()

good luck


--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/7d4520ac-cace-4462-b283-999ab65a44b4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--


Bests,
madoodia

tushar sankhala

unread,
Sep 20, 2014, 3:04:17 AM9/20/14
to python_in...@googlegroups.com

Hi madoodia,

Thanks for the Reply.

Code Snippet is

in mayapy

I am giving these command:

>>> import maya.standalone                                       (Runs Fine)
>>> maya.standalone.initialize()                                  (Runs Fine)
>>> import pymel.core as pmc                                     (Error: pymel.internal.startup : ERROR : maya.standalone was successfully initialized, but pymel failed to import maya.cmds (or it was not populated)
                                                                                                 Traceback (most recent call last):
                                                                                                 File "<stdin>", line 1, in <module>
                                                                                                 File "C:\Program Files\Autodesk\Maya2014\Python\lib\site-packages\pymel\core\_
                                                                                                 _init__.py", line 11, in <module>
                                                                                                  _startup.mayaInit()
                                                                                                  File "C:\Program Files\Autodesk\Maya2014\Python\lib\site-packages\pymel\internal\startup.py", 
                                                                                                  line 170, in mayaInit from maya.cmds import about
                                                                                                  ImportError: cannot import name about)

Thanks
Tushar

To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsub...@googlegroups.com.



--


Bests,
madoodia

Mahmoodreza Aarabi

unread,
Sep 20, 2014, 3:17:24 AM9/20/14
to python_in...@googlegroups.com

ok,

did you use import pymel.core as pmc in external python interpreter?

i have another problem in Maya2014 (script editor) but when i import pymel.core as pm it give me a error dialog :
Inline image 2

but it works, when i run for example:

pm.spaceLocator()

i added C:\Program Files\Autodesk\Maya2014\Python\lib\site-packages\ to my PYTHONPATH

but when run maya.standalone.initialize() in external python interpreter it give me error dialog.

and not work

same as import pymel.core as pm.

I interested to know why these happens inside and outside of maya2014 too.


To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/6eabd775-454a-42d5-bfc2-421fb7d78b38%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--


Bests,
madoodia

tushar sankhala

unread,
Sep 20, 2014, 4:20:33 AM9/20/14
to python_in...@googlegroups.com
I have tried "import pymel.core as pmc"

both in mayapy console and external editor "wingsIDE"

but no luck.

Thanks
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsubscribe@googlegroups.com.



--


Bests,
madoodia

--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsub...@googlegroups.com.



--


Bests,
madoodia

Mahmoodreza Aarabi

unread,
Sep 20, 2014, 4:25:23 AM9/20/14
to python_in...@googlegroups.com

I test it too:
this is my result:

C:\Users\madoodia>mayapy

Python 2.7.3 (default, Aug  1 2012, 16:33:56) [MSC v.1600 64 bit (AMD64)] on win
32
Type "help", "copyright", "credits" or "license" for more information.
>>> import maya.standalone
>>> maya.standalone.initialize()
Registered E:\Madoodia\_GitHub\pyblish-maya\pyblish_maya\plugins
>>> import pymel.core as pm
pymel.internal.factories : INFO : MFnDagNode.model is deprecated
Warning: file: C:/Program Files/Autodesk/Maya2014/scripts/startup/initialStartup
.mel line 192: Y-axis is already the Up-axis
pymel.internal.startup : ERROR : could not perform Maya initialization sequence:
 failed on namedCommandSetup.mel: Error occurred during execution of MEL script

To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/90f53dac-d005-421d-9cdc-a152e7e1f5ae%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--


Bests,
madoodia

tushar sankhala

unread,
Sep 20, 2014, 4:48:39 AM9/20/14
to python_in...@googlegroups.com
So there is also a problem with your Pymel but i think it is a different one right now i am checking the startup.py file in pymel folder that error comes from there.
I you find any solution for this please share it.

Or i will wait for some other guys to reply for this if anyone else is having this issue and has fixed it.

Thanks



--


Bests,
madoodia

--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsub...@googlegroups.com.



--


Bests,
madoodia

Mahmoodreza Aarabi

unread,
Sep 20, 2014, 4:51:57 AM9/20/14
to python_in...@googlegroups.com
Yes, i a have another problem,
Sure, if i find i will tell you.

and we wait for other guys
;)
good luck

To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/a9da9681-68d0-4874-987e-0d905d948068%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--


Bests,
madoodia

tushar sankhala

unread,
Sep 20, 2014, 5:08:57 AM9/20/14
to python_in...@googlegroups.com
I have tested the same command in the Maya Script Editor

and it runs fine so that issue is only in the mayapy.exe interpreter.

does your happens in maya script editor as well.



--


Bests,
madoodia

--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsub...@googlegroups.com.



--


Bests,
madoodia

Mahmoodreza Aarabi

unread,
Sep 20, 2014, 5:27:48 AM9/20/14
to python_in...@googlegroups.com
with pymel i have same problem in maya too

To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/1c2e30a0-d04c-4ac9-9484-cd554ee2ecdf%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--


Bests,
madoodia

Geordie Martinez

unread,
Sep 20, 2014, 4:17:17 PM9/20/14
to python_in...@googlegroups.com
Later in in the book (page 256-257) galanakis shows how to defer the loading of pymel.

Try that perhaps it will help out.
--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.

Mahmoodreza Aarabi

unread,
Sep 20, 2014, 4:33:14 PM9/20/14
to python_in...@googlegroups.com
Can you give Full name of book?
or give any link of the page?



For more options, visit https://groups.google.com/d/optout.



--


Bests,
madoodia

Justin Israel

unread,
Sep 20, 2014, 4:36:45 PM9/20/14
to python_in...@googlegroups.com
On Sun, Sep 21, 2014 at 8:33 AM, Mahmoodreza Aarabi <mado...@gmail.com> wrote:
Can you give Full name of book?
or give any link of the page?

It was already mentioned in the first post: Practical Maya Programming Book by Robert Galanakis
 

Mahmoodreza Aarabi

unread,
Sep 20, 2014, 4:38:35 PM9/20/14
to python_in...@googlegroups.com
OK, i found the book.
thanks.


For more options, visit https://groups.google.com/d/optout.



--


Bests,
madoodia

Mahmoodreza Aarabi

unread,
Sep 20, 2014, 4:51:15 PM9/20/14
to python_in...@googlegroups.com
I found the book link i mean. not the book itself.
anyway thanks
;)
--


Bests,
madoodia

Paul Molodowitch

unread,
Sep 20, 2014, 9:13:59 PM9/20/14
to python_inside_maya

Interesting... That should work, so I'll take a look when I'm at a computer with Maya, but as a workaround, what happens if you just do "import pymel.core" without the maya.standalone.initialize()?

Mahmoodreza Aarabi

unread,
Sep 21, 2014, 2:07:56 AM9/21/14
to python_in...@googlegroups.com

For me, i have the error (Error Dialog) in maya too, when i use this command:
import pymel.core
or
import pymel.core as pm
but i don’t know tushar sankhala’s error.
and i could not get the book.

Geordie Martinez, if you have the book please share that page.
thanks


On Sun, Sep 21, 2014 at 4:43 AM, Paul Molodowitch <elro...@gmail.com> wrote:

Interesting... That should work, so I'll take a look when I'm at a computer with Maya, but as a workaround, what happens if you just do "import pymel.core" without the maya.standalone.initialize()?

--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--


Bests,
madoodia

tushar sankhala

unread,
Sep 21, 2014, 6:37:02 AM9/21/14
to python_in...@googlegroups.com
Hi,

I tried what you suggested, i tried executing:

import pymel.core without the maya.standalone.initialize()

and it worked but with one error 

pymel.internal.startup : ERROR : could not perform Maya initialization sequence:
 failed on namedCommandSetup.mel: Error occurred during execution of MEL script

i have found out there is a problem with the "about" module in the maya.cmds

confusion is if i run in mayapy.exe:

First try:
>>> import maya.cmds as mc
>>> mc.about

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'about'

Second try:

Restarted mayapy

>>> import pymel.core as pmc

pymel.internal.factories : INFO : MFnDagNode.model is deprecated
Warning: file: D:/Program Files/Autodesk/Maya2014/scripts/startup/initialStartup
.mel line 192: Y-axis is already the Up-axis
pymel.internal.startup : ERROR : could not perform Maya initialization sequence:
 failed on namedCommandSetup.mel: Error occurred during execution of MEL script

>>> mc.about
<built-in method about of module object at 0x0000000002805678>

so now it is able to find the about module in maya.cmds if i import pymel.core before maya.cmds

Can some one tell what is the issue.

Thanks

Paul Molodowitch

unread,
Sep 21, 2014, 12:34:39 PM9/21/14
to python_inside_maya
Hmm... namedCommandSetup.mel is a file in the maya user profile - what happens if you wipe your user settings dir? You can just rename it temporarily (Note - on windows, you may need to make sure that "Autodesk Application Manager" is not running in the background before it will let you rename your maya dir...):

(shell prompt) > mv %USERPROFILE%\Documents\maya %USERPROFILE%\Documents\maya.bak
(shell prompt) > "C:\Program Files\Autodesk\Maya2014\bin\mayapy"

(mayapy prompt) >>> import pymel.core as pm

...

(shell prompt) mv %USERPROFILE%\Documents\maya.bak %USERPROFILE%\Documents\maya

Does it still give the same error?


--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.

Carlos Montes

unread,
Sep 27, 2014, 3:29:59 AM9/27/14
to python_in...@googlegroups.com
I was having the same issue, but according to help I've seen from other places, pymel.core is actually imported, regardless of the error that is thrown.

You can verify it by typing dir(pmc) and seeing its result. If you keep typing the next sentences provided in the example, everything keeps working as expected.

It is very odd, and I'm also starting too. I hope no other issues are found in the future regarding this import.

AJ

unread,
Oct 26, 2016, 8:49:06 AM10/26/16
to Python Programming for Autodesk Maya
Hello everyone,

I'm having the same issue and I was wondering if anyone found the solution for the import error?

Marcus Ottosson

unread,
Oct 26, 2016, 9:23:44 AM10/26/16
to python_in...@googlegroups.com

To fully understand the problem, would it be possible to post a reproducible?

For example.

$ cd c:\program files\autodesk\maya2016\bin
$ mayapy
>>> from maya import standalone
>>> standalone.initialize()
>>> from pymel import core
...

On 26 October 2016 at 13:49, AJ <ali.jaf...@gmail.com> wrote:
Hello everyone,

I'm having the same issue and I was wondering if anyone found the solution for the import error?

--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/81541c08-6d56-4753-b9d1-6ed09d500372%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Marcus Ottosson
konstr...@gmail.com

AJ

unread,
Oct 26, 2016, 9:28:16 AM10/26/16
to Python Programming for Autodesk Maya
Reply all
Reply to author
Forward
0 new messages