Tk-engine Qt import error in maya-2023

Hello,

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\menu_generation.py", 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\__init__.py", line 1481, in exception
#     self.error(msg, *args, exc_info=exc_info, **kwargs)
#   File "C:\Program Files\Autodesk\Maya2023\Python\lib\logging\__init__.py", line 1475, in error
#     self._log(ERROR, msg, args, **kwargs)
#   File "C:\Program Files\Autodesk\Maya2023\Python\lib\logging\__init__.py", line 1589, in _log
#     self.handle(record)#   File "C:\Program Files\Autodesk\Maya2023\Python\lib\logging\__init__.py", line 1599, in handle
#     self.callHandlers(record)
#   File "C:\Program Files\Autodesk\Maya2023\Python\lib\logging\__init__.py", line 1661, in callHandlers
#     hdlr.handle(record)
#   File "C:\Program Files\Autodesk\Maya2023\Python\lib\logging\__init__.py", 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\engine_logging.py", 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\engine.py", 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\engine.py", 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\engine.py", 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\p1282c4864.basic.shell\cfg\install\core\python\tank\platform\qt\__init__.py)

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

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

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.