# Python script works in the Editor but fails at Commandlet.

**URL:** <https://forums.unrealengine.com/t/python-script-works-in-the-editor-but-fails-at-commandlet/447757>\
**Category:** Editor Scripting\
**Tags:** Python, unreal-engine, editor, Scripting, question\
**Created:** [April 24, 2019, 6:19am UTC](https://forums.unrealengine.com/t/python-script-works-in-the-editor-but-fails-at-commandlet/447757 "2019-04-24T06:19:57Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![kakyoism](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@kakyoism](https://forums.unrealengine.com/u/kakyoism)\
**Post date:** [April 24, 2019, 6:19am UTC](https://forums.unrealengine.com/t/python-script-works-in-the-editor-but-fails-at-commandlet/447757/1 "2019-04-24T06:19:57Z")

</div>

My script works in the Editor but fails when run from Cmdlet:

Command line:

```
"C:\Program Files\Epic Games\UE_4.21\Engine\Binaries\Win64\UE4Editor-Cmd.exe" "/path/to/my.uproject" -run=pythonscript -script="/path/to/select_assets.py"

```

The code:

```
import unreal as ue    
toselect = ['/Game/Path/To/MyAsset1', '/Game/Path/To/MyAsset2',]    
ue.EditorAssetLibrary.sync_browser_to_objects(toselect)

```

Running this from the Editor I would see the selected objects listed in the Content Browser’s main view.  
However, other than a console window pops up (see screenshot), nothing happens in the Editor.

What am I missing?

![275050-15560878733731.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/d/e/2de7d680454b65d26a319b8dc42e008230740c85.png)

---

<div class="post-metadata">

**Author:** ![Anonymous\_9fe7be10542cf6d7944be2b3fd498685](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Anonymous\_9fe7be10542cf6d7944be2b3fd498685](https://forums.unrealengine.com/u/Anonymous_9fe7be10542cf6d7944be2b3fd498685)\
**Post date:** [February 14, 2024, 5:15am UTC](https://forums.unrealengine.com/t/python-script-works-in-the-editor-but-fails-at-commandlet/447757/2 "2024-02-14T05:15:08Z")

</div>

Hello, have you resolved it? I have also encountered this issue. I hope to open the Unreal project file in an external Python editor and execute the Python script I executed in Unreal, but it only pops up a box and does not actually open the Unreal editor
