Setting up Autocomplete for Editor Python Scripting

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

Windows
MacOS
Linux

Prerequisite: Enable Developer Mode

Before setting up autocomplete, you'll need to tell the Unreal Engine 4 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 (ProjectDirectory)/Intermediate/PythonStub.

PyCharm

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

Add the Python stub file path

You'll 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 Unreal Engine 4 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 VSCode, you should now be able to see functions from the UE4 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.

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss