- Download and install the Eclipse SDK.
- Use Eclipse’s Software Update window (under help) to install PyDev
- You may also want to install a trial of PyDev Extensions. I can’t live without its Mark Occurrences feature.
Open the Eclipse preferences window.
Windows
OSX
under the Window menu:
under the Eclipse menu:
![]()
![]()
In the left pane, drop down to Pydev > Interpreter-Python
Click the New.. button at the top right of the Python Interpreters preferences window
In the browser that comes up, you want to choose Maya’s python interpreter: mayapy.
Note
On osx, browsing to mayapy is not as easy as it should be. The problem is that it’s buried within Maya.app, which you cannot access in a file browser (thanks Apple!). To get to it, hold down Command+Shift+G to bring up a box to enter a path (that’s the Apple “Command” button, plus Shift, plus the letter G). Due to a bug on Eclipse’s part, you can’t paste a path in this browser, so you’ll have to arduously type it out ( luckily, it does have some basic tab completion to help you along ).
Windows
OSX
C:\Program Files\Autodesk\Maya2009\bin\mayapy.exe
/Applications/Autodesk/maya2009/Maya.app/Contents/bin/mayapy
Once you choose the “mayapy” binary, you’ll get this window:
Windows
OSX
on windows: add a check beside python25.zip.
If you installed PyMEL using the Easy Install method, you’ll see the pymel “egg” in the list of automatically detected site packages. Press “OK” and skip down to the next section.
If you installed PyMEL using the Manual Install method, then you will have to add the directory above your pymel folder to the list of System Libs. To do this, first click “OK” to confirm the automatically detected libs. After it finishes parsing the directories click the New Folder button and browse to the directory above your pymel folder.
Because PyMEL contains many dynamically created functions and classes, simply parsing its modules is not sufficient to produce the full set of completions. Luckily, Pydev has a special list of modules that it inspects more thoroughly. Starting from where we left off in the Pydev preferences under Python Interpreters...
Change to the Forced Builtins tab.
Add each of the following PyMEL builtins:
pymel.api.allapi pymel.core.animation pymel.core.datatypes pymel.core.effects pymel.core.general pymel.core.language pymel.core.modeling pymel.core.nodetyeps pymel.core.other pymel.core.rendering pymel.core.system pymel.core.windowsNote
I’ve left a few modules out that are less often used, such as pymel.core.runtime and pymel.core.context. Feel free to add these, too.
If you plan on doing any Maya plugin development you should also add these to your builtins (or at least OpenMaya and OpenMayaMPx):
maya.OpenMaya maya.OpenMayaAnim maya.OpenMayaCloth maya.OpenMayaFX maya.OpenMayaMPx maya.OpenMayaRender![]()
The last step is to add the environment variables that enable the python interpreter to properly load Maya’s libs.
Note
On Windows this step is optional if you properly setup your environment.
Change to the Environment tab.
Add the following variables, using the proper path for your installation of Maya:
Windows Variables:
Name
Example Value
MAYA_LOCATION
C:\Program Files\Autodesk\Maya2009
![]()
OSX Variables:
Name
Example Value
MAYA_LOCATION
/Applications/Autodesk/maya2009/Maya.app/Contents
DYLD_LIBRARY_PATH
/Applications/Autodesk/maya2009/Maya.app/Contents/MacOS
DYLD_FRAMEWORK_PATH
/Applications/Autodesk/maya2009/Maya.app/Contents/Frameworks
![]()
Double check that your environment variable points to the same version of Maya as the Maya site-packages directory under the Libraries tab
Press OK in the Preference window and wait while Pydev parses all your python files.
Restart Eclipse
Create a new file from within eclipse ( File / New / File ) named foo.py or whatever you want ( just make sure to include the .py )
Add the following line:
import pymelNow type:
pymel.binThere should be a pause at the period. ( If you are using OSX, you should see a Python app open up in your dock. This is good. It means eclipse is initializing maya and doing a full inspection of PyMEL. ) Afterwards, you should get bindSkin() as a completion. Don’t worry, this long pause will only happen once per eclipse session.
![]()
Note
If you like to import everything from pymel, aka from pymel import *, then you should open the Eclipse preferences, go to Pydev > Editor > Code Completion, and enable Autocomplete on all letter chars and ‘_’
If you’re still not getting completion:
- Go to Eclipse preferences under Pydev > Editor > Code Completion and increase Timeout to connect to shell to 30 seconds or more.
- Restart Eclipse and retry steps 3 and 4 above
- Open a log view (Window / Show View / Error Log) and if you see any suspicious errors, post for help at the Pydev suport forum