PyMEL is an open-source Python library that helps with the development of Maya extensions by providing a simplified syntax for common operations.
PyMEL is developed and maintained by LUMA pictures. Autodesk does not directly support PyMEL. Visit https://pypi.org/project/pymel/ to find the version of PyMEL that is compatible with your version of Maya.
PyMEL is installed using the pip package manager. Consult the the pip user guide for the most up-to-date information about installing using pip.
By default, PyMEL is installed in the Maya site-package directory. To install PyMEL in your user space, run the installation command with the --user option.
To install PyMEL, change directory to where mayapy is installed, and then run pip install pymel.
Install PyMEL | On Windows | On macOS and Linux |
---|---|---|
To site-packages: | mayapy -m pip install pymel | sudo ./mayapy -m pip install pymel |
To your user space: | mayapy -m pip install --user pymel | ./mayapy -m pip install --user pymel |
Use mayapy -m pip list to verify that PyMEL is installed.
To use the PyMEL library, open the Python Script Editor and execute the following command:
import pymel.core as pm
Once you have imported the PyMEL library, you can use the PyMEL commands. For example, you can create a sphere:
s = pm.sphere()
To uninstall PyMEL, use mayapy -m pip uninstall pymel. You will need Administrator privileges on Windows, and super user privileges on macOS and Linux to uninstall PyMEL if it was installed in Maya's site-packages directory.