AMI and Qt import bug

Hey, we have an AMI that fails on one specific machine. Tried comparing every detail I could think of, but the setup seems identical to other places where it works.
Apparently an ImportError in saml core is used to indicate that Qt cannot be used, such as in a terminal session, which is handled gracefully.
However, a KeyError is thrown instead, which breaks the former mechanism. Not sure if Python is supposed to rethrow an ImportError once this fails.

Any ideas are welcome.

Qt: Untested Windows version 6.2 detected!
ERROR |btl_shotgun_ami.handlers.main|2021-01-19 13:01:11,487|Traceback (most recent call last):
File "c:\python27\lib\site-packages\btl_shotgun_ami\handlers\", line 39, in handle_request
File "c:\python27\lib\site-packages\btl_shotgun_ami\", line 85, in handler
return func(request_data, get_toolkit_for_request(request_data))
File "c:\python27\lib\site-packages\btl_shotgun_ami\", line 70, in get_toolkit_for_request
sgtk = get_sgtk_for_request(request_data, ids, sg)
File "c:\python27\lib\site-packages\btl_shotgun_ami\", line 63, in get_sgtk_for_request
File "c:\python27\lib\site-packages\btl_shotgun\", line 86, in get_sgtk_from_project_name_hardcoded
import sgtk
File "z:/_pipeline/shotgun_config\<redacted>\install\core\python\sgtk\", line 16, in <module>
import tank
File "z:/_pipeline/shotgun_config\<redacted>\install\core\python\tank\", line 110, in <module>
from . import authentication
File "z:/_pipeline/shotgun_config\<redacted>\install\core\python\tank\authentication\", line 35, in <module>
from .shotgun_authenticator import ShotgunAuthenticator
File "z:/_pipeline/shotgun_config\<redacted>\install\core\python\tank\authentication\", line 13, in <module>
from .sso_saml2 import has_sso_info_in_cookies, has_unified_login_flow_info_in_cookies
File "z:/_pipeline/shotgun_config\<redacted>\install\core\python\tank\authentication\sso_saml2\", line 15, in <module>
from .core.errors import ( # noqa
File "z:/_pipeline/shotgun_config\<redacted>\install\core\python\tank\authentication\sso_saml2\core\", line 15, in <module>
from .sso_saml2_core import SsoSaml2Core # noqa
File "z:/_pipeline/shotgun_config\<redacted>\install\core\python\tank\authentication\sso_saml2\core\", line 46, in <module>
from .username_password_dialog import UsernamePasswordDialog
File "z:/_pipeline/shotgun_config\<redacted>\install\core\python\tank\authentication\sso_saml2\core\", line 17, in <module>
from ...ui.qt_abstraction import QtCore, QtGui
File "z:/_pipeline/shotgun_config\<redacted>\install\core\python\tank\authentication\ui\", line 22, in <module>
QtWebEngineWidgets = _importer.QtWebEngineWidgets
File "z:/_pipeline/shotgun_config\<redacted>\install\core\python\tank\util\", line 86, in QtWebEngineWidgets
return self._modules["QtWebEngineWidgets"] if self._modules else None
KeyError: 'QtWebEngineWidgets'

Actually we found out that the Python version was different there - 2.7.11, while the other machines had 2.7.16. Artifact of the past, it seems.
The above error is gone, now we have another one :slight_smile: but it’s in our code this time.

1 Like