Setting up Autocomplete for Editor Python Scripting

A short guide to setting up autocomplete for editor Python scripting.

Choose your operating system:

Windows

macOS

Linux

Prerequisite: Enable Developer Mode

Before setting up autocomplete, you will need to tell the Unreal Engine (UE) Python Plugin to generate the necessary stubs. You can do this by checking Developer Mode in Editor Preferences > Plugins > Python, then restarting the editor. The generated stub file will be located at [Current Project Directory]/Intermediate/PythonStub.

PyCharm

Open the Settings window and navigate to Project > Python Interpreter, then click the gear and select Show all. In the Python Interpreter window, you can click the Paths button and click + to add the location of your stub file.

Add the Python stub file path

You will also need to raise the maximum Intellisense file size by navigating to Help > Edit Custom Properties and adding the following:

    idea.max.intellisense.filesize = 25000

After restarting PyCharm, you will be able to see functions from the UE API in the autocomplete menu.

VSCode

Navigate to Settings > Extension > Python and find Auto Complete: Extra Paths. Click the link to open the settings.json file, and add the path to your stub file under python.autoComplete.extraPaths.

The Python autocomplete path settings

Setting the path in the settings.json file

After restarting Visual Studio Code (VSCode), you should now be able to see functions from the UE API in the autocomplete menu.

The stub file is regenerated each time the editor is started. As a result, you can restart the editor after exposing new functions to Python or enabling new plugins to ensure the stub file is up to date.