diff --git a/openpype/pype_commands.py b/openpype/pype_commands.py index f744337c672..7c4fd8f1a38 100644 --- a/openpype/pype_commands.py +++ b/openpype/pype_commands.py @@ -97,8 +97,6 @@ def publish(paths, targets=None, gui=False): install_openpype_plugins, get_global_context, ) - from openpype.tools.utils.host_tools import show_publish - from openpype.tools.utils.lib import qt_app_context # Register target and host import pyblish.api @@ -150,6 +148,8 @@ def publish(paths, targets=None, gui=False): print(plugin) if gui: + from openpype.tools.utils.host_tools import show_publish + from openpype.tools.utils.lib import qt_app_context with qt_app_context(): show_publish() else: