"NameError: Can't find file for module maya" while trying to run a Python script in Eclipse
Question: I setup Eclipse IDE for editing and debugging Maya scripts. When I try to run
the code:

    
    
    import maya.cmds as cmds
    cmds.ls()
    

in Eclipse I get the error:

    
    
        import maya.cmds as cmds
    NameError: Can't find file for module maya
    (filename C:\Users\shivani\My Documents\maya)
    

I configured eclipse to use maya and python like the following:

![enter image description here](http://i.stack.imgur.com/smdIX.png)

I don't understand what is the problem or I'm not able to use Eclipse
properly?


Answer: [Configure](http://pydev.org/manual_101_interpreter.html) Eclipse to use
`mayapy` Python interpreter available in `<Maya_INSTALL_DIR>\bin`.

Or else you will have to initialize the default Python interpreter with Maya
as explained [here](http://stackoverflow.com/a/18566701/1309352).

