Maya Completion Files for Pylint
The default Python modules for Maya (e.g. maya.cmds, maya.OpenMaya, etc...) are not suitable for Pylint and can result in errors that are false-positives.
Examples of these errors are:
- - [E0401] Unable to import maya.cmds
- - [E1101] Module maya.cmds has no 'ls' method
The workaround for this is found in the Maya devkit and is available to download, for free, from the Maya Developer Center. The devkit contains stubs for all of the Python modules in Maya and can be used by Pylint to avoid these errors.
Download the Completion Files
- Download the Maya devkit from the Maya Developer Center (scroll down to devkits)
- Extract the contents of the zip file to a temporary location
- From the devkit root directory, navigate to "devkitBase/devkit/other/pymel/extras/completion/"
- Copy the "py" folder to a permanent location
- Rename the copied folder to something more helpful (e.g. "completion")
The contents of the completion folder should look something like this:
Add the Completion Folder to the Pylint Path
- Open the CE2 Preferences (Edit->Preferences) and select Pylint
- Under Additional Pylint Paths add the absolute path to the completion folder
- Click OK