Executing Python script from outside the editor?

I am making an automation pipeline and am running into some difficulties communicating with UE’s python environment from an external tool. According to this documentation you can run a python script from the command line. However, it only runs a single script and then exists the editor. I want to be able to run a script in the currently opened project by triggering the script in an custom external tool. Because Unreal has a separate python interpreter, this has proved to be a challenge. Any insight would be helpful! Thank you in advance! :slight_smile:

2 Likes

Hi there,

did you figure this out? Trying to solve this issue as well.

If people are still struggling with this, here’s how to achieve it
Go where your Unreal Editor binary is, Usually under “C:\Program Files\Epic Games\UE_5.5\Engine\Binaries\Win64”
Open your PowerShell and execute the following
\UnrealEditor-Cmd.exe" “C:\UnrealProjects\YourProject.uproject” -run=pythonscript -Script=“PathToScript\Script.py” -unattended -nullrhi