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: Maya 2017 and 2018 use Python 2.7.x (64-bit). It is highly recommended that you use a version of Python that closely matches Maya.

Installing Python (Windows)

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

  1. Download Python:
  2. Install Python (make a note of the installation location)
    e.g C:/Python27

Installing Python (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

  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.