Managing Python packages with mayapy and pip

The standard Python package management system, pip, can be used within Maya's Python interpreter to install, search for, and query Python packages.

pip is called from the command line using mayapy, the Maya Python interpreter. It cannot be called from within the Maya Python script editor.

You can see a list of installed packages by running ./mayapy -m pip list on macOS and Linux, and mayapy -m pip list on Windows.

For the most up-to-date information about pip, see the pip user guide.

mayapy is located in the following directories:
Windows C:\Program Files\Autodesk\Maya<VersionNumber>\bin
macOS /Applications/Autodesk/maya<VersionNumber>/Maya.app/Contents/bin
Linux /usr/autodesk/Maya<VersionNumber>/bin/

Pip will install packages to Maya's site-packages directory by default. You will need Administrator privileges on Windows, or super user privileges on macOS and Linux, to install packages in these directories.

If you do not have these privileges, or if you do not want to install packages in these directories, you can install packages in your user space using the --user flag, or you can install packages in the version-specific site-packages directory using the --target option.

The version-specific site-packages directories are created when you start Maya.

You do not need Administrator or super user privileges to install packages to the version-specific site-packages directories, and the packages in these directories will be prioritized over packages installed in the other locations.

Installing packages on Windows

Installing to Maya's default site-packages directory mayapy -m pip install <flags> <package>

Must be run from a command window running as Administrator

Installing to your user space mayapy -m pip install <flags> --user <package>
Installing to the version-specific directory mayapy -m pip install <flags> <package> --target C:/Users/<username>/Documents/maya/<version>/scripts/site-packages

Installing packages on macOS

Installing to Maya's default site-packages directory sudo ./mayapy -m pip install <flags> <package>
Installing to your user space ./mayapy -m pip install <flags> --user <package>
Installing to the version-specific directory ./mayapy -m pip install <flags> <package> --target $HOME/Library/Preferences/Autodesk/maya/<version>/scripts/site-packages

Installing packages on Linux

Installing to Maya's default site-packages directory sudo ./mayapy -m pip install <flags> <package>
Installing to your user space ./mayapy -m pip install <flags> --user <package>
Installing to the version-specific directory ./mayapy -m pip install <flags> <package> --target $HOME/maya/<version>/scripts/site-packages
Note: pip will try to install packages in the Maya site-packages directory by default. If you do not have proper permissions to install in that directory, packages will be installed in your user space.

Uninstalling Packages

Use pip uninstall <package> to delete a package from your user space:

Linux and macOS ./mayapy -m pip uninstall <package>
Windows mayapy -m pip uninstall <package>

If you installed to the Maya site-packages directory, you will need Administrator or super user privileges to uninstall the package:

Linux and macOS sudo ./mayapy -m pip uninstall <package>
Windows mayapy -m pip uninstall <package>

If you installed to the version-specific site-packages directory, you will need to manually delete the package from the version specific site-package directory:

  1. Change directory to the version-specific site-packages directory
  2. Find directory of the package you want to delete
  3. Delete the entire directory