Skip to main content

Charcoal Editor 2 Documentation

Installing and Enabling Pylint

Pylint is a standalone application that can be downloaded or built from source code. The documentation below will provide one method for downloading the executable. Once the application has been copied to the host machine, the location of the pylint executable needs to set in Charcoal Editor 2's preferences.

One of the easist ways to download Pylint is by using "pip". Pip is a package management system used to install and manage software packages written in Python. It is included with recent versions of Python. If you already have a 64-bit version of Python installed, the "Installing Python" section can be skipped.

Note: There are separate guides below for Maya 2022 and newer (Python 3) and earlier versions of Maya (Python 2).

Maya 2022+ (Python 3)

Installing Pylint

Starting with Maya 2022 (Python 3) pip is included in the standard Maya installation and can be used to install Pylint.

  1. Open a Command Prompt or Terminal and navigate to Maya's bin folder:

    Windows:

    C:\Program Files\Autodesk\Maya<VersionNumber>\bin

    macOS:

    /Applications/Autodesk/maya<VersionNumber>/Maya.app/Contents/bin
  2. Run the following command:

    Windows:

    mayapy -m pip install --user pylint

    macOS:

    ./mayapy -m pip install --user pylint

Enabling Pylint in Charcoal Editor 2

Pylint is enabled and configured through the Charcoal Editor 2 Preferences dialog. From the CE2 main menu select Edit->Preferences and select "Pylint" from the Sidebar. The dialog is displayed below:

  1. Find the path to the Pylint executable: pylint.exe (Windows) or pylint (macOS)

    mayapy -m pip show -f pylint
  2. Set the Pylint Executable Path

    Example:

    C:/Users/<username>/AppData/Roaming/Python/Python37/Scripts/pylint.exe
  3. Check the Pylint Enabled checkbox under "Pylint Code Analysis"

  4. Click OK

You can verify Pylint is working by creating an obvious syntax error in a Python file and confirming that an error is displayed.

If things don't appear to be working, enable Log Output Errors in the Preferences and make a code changes to force a Pylint refresh. Any errors from Pylint will be reported in the Output Window.

Note: You may need to add the directory of the executable to system PATH to use pylint.

Maya 2017-2020 (Python 2.7.x)

Installing Python

Starting with Maya 2022 (Python 3) pip is included in the standard Maya installation and can be used to install Pylint.

Note: Maya 2017-2020 use Python 2.7.x (64-bit). It is highly recommended that you use a version of Python that closely matches Maya.

Windows

Note: It is very important that you download a 64-bit (x86-64) version of Python

  1. Download Python: https://www.python.org/downloads/release/python-2715/

  2. Install Python (make a note of the installation location)

    e.g C:/Python27
macOS

Python 2.7.x is installed by default on recent versions of macOS. However, "pip" is not included and is required to complete the steps in the next section.

  1. Install pip

    sudo easy_install pip

Note: Other methods of installing Pylint are available on macOS (e.g. Homebrew) but are beyond the scope of this document.

Installing Pylint (Maya 2017-2020)

  1. Open a Command Prompt or Terminal. On Windows, navigate to the Python root directory (install location)

  2. Run the following command:

    python -m pip install pylint
  3. Note the location of the pylint executable:

    Windows - pylint.exe should be in the Scripts folder (Python root directory)

    macOS - Run the following command to get the pylint path:

    which pylint

Note: Additional installation options can be found in the Pylint documentation.

Enabling Pylint in Charcoal Editor 2

Pylint is enabled and configured through the Charcoal Editor 2 Preferences dialog. From the CE2 main menu select Edit->Preferences and select "Pylint" from the Sidebar. The dialog is displayed below:

  1. Set the Pylint Executable Path. It should be in the "Scripts" folder of the Python root directory.

    e.g. C:/Python27/Scripts/pylint.exe
  2. Check the Pylint Enabled checkbox under "Pylint Code Analysis"

  3. Click OK

You can verify Pylint is working by creating an obvious syntax error in a Python file and confirming that an error is displayed.

If things don't appear to be working, enable Log Output Errors in the Preferences and make a code changes to force a Pylint refresh. Any errors from Pylint will be reported in the Output Window.