Just change PyQt5 to PyQt6:
from PyQt6.QtGui import qt_set_sequence_auto_mnemonic
That works for me. Please let me know is it worked for you.