Tk-engine Qt import error in maya-2023


I am trying to test maya-2023 together with sgtk. I am aware that the toolkit integrations do not yet support maya-2023 officially.

When launching maya-2023 and doing a tk-multi-publish2 publish I get the following error:

# Traceback (most recent call last):
#   File "C:\Program Files\Shotgun\Resources\Desktop\Python\bundle_cache\app_store\tk-maya\v0.11.1\python\tk_maya\", line 239, in _execute_within_exception_trap
#     current_engine.logger.exception("An exception was raised from Toolkit")
#   File "C:\Program Files\Autodesk\Maya2023\Python\lib\logging\", line 1481, in exception
#     self.error(msg, *args, exc_info=exc_info, **kwargs)
#   File "C:\Program Files\Autodesk\Maya2023\Python\lib\logging\", line 1475, in error
#     self._log(ERROR, msg, args, **kwargs)
#   File "C:\Program Files\Autodesk\Maya2023\Python\lib\logging\", line 1589, in _log
#     self.handle(record)#   File "C:\Program Files\Autodesk\Maya2023\Python\lib\logging\", line 1599, in handle
#     self.callHandlers(record)
#   File "C:\Program Files\Autodesk\Maya2023\Python\lib\logging\", line 1661, in callHandlers
#     hdlr.handle(record)
#   File "C:\Program Files\Autodesk\Maya2023\Python\lib\logging\", line 952, in handle
#     self.emit(record)
#   File "C:\local_pipe\rez\cache\tk_core\0.20.6-d\f965\a\extracted\python\tank\platform\", line 47, in emit
#     self._engine._emit_log_message(self, record)
#   File "C:\Program Files\Shotgun\Resources\Desktop\Python\bundle_cache\app_store\tk-maya\v0.11.1\", line 829, in _emit_log_message
#     self.async_execute_in_main_thread(fct, msg)
#   File "C:\local_pipe\rez\cache\tk_core\0.20.6-d\f965\a\extracted\python\tank\platform\", line 1186, in async_execute_in_main_thread
#     self._execute_in_main_thread(self._ASYNC_INVOKER, func, *args, **kwargs)
#   File "C:\local_pipe\rez\cache\tk_core\0.20.6-d\f965\a\extracted\python\tank\platform\", line 1208, in _execute_in_main_thread
#     from .qt import QtGui, QtCore
# ImportError: cannot import name 'QtGui' from 'tank.platform.qt' (C:\Users\stu\AppData\Roaming\Shotgun\studio\\cfg\install\core\python\tank\platform\qt\

It seems like a problem wth tk-engine initialization. Particularly with this interestng way of importing qt here in

That is my assumtion because the, that’s eventually used to import qt into the tank.platform.qt namespace, works fine on its own.

from tank.util.qt_importer import QtImporter
importer = QtImporter()
assert importer.QtGui

Any hints or tips are very much appreciated.

have you found a way to solve this?

Seems like you have a local/custom version of tk-core which is not the latest version.
I would look at updating.

Maya 2023 works fine for me out of the box.