question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Import `QtCore.Qt` failure - `AttributeError: Cannot reassign members.`

See original GitHub issue

Running in a venv;

Python 3.9.13 (tags/v3.9.13:6de2ca5, May 17 2022, 16:36:42) [MSC v.1929 64 bit (AMD64)] on win32
packaging==21.3
pip==22.0.4
pyparsing==3.0.9
PySide6==6.4.0
PySide6-Addons==6.4.0
PySide6-Essentials==6.4.0
QtPy==2.2.1
setuptools==58.1.0
shiboken6==6.4.0

from qtpy.QtCore import Qt

results in;

Traceback (most recent call last):
  File "C:\Users\XXXXXXXX\Desktop\okko.py", line 1, in <module>
    \ufefffrom qtpy.QtCore import Qt
  File "C:\Users\XXXXXXXX\Desktop\okko\.venv\lib\site-packages\qtpy\QtCore.py", line 116, in <module>
    Qt.MidButton = Qt.MouseButton.MiddleButton = Qt.MiddleButton
  File "shibokensupport/enum_310.py", line 529, in __setattr__
AttributeError: Cannot reassign members.

Qt.MouseButton.MiddleButton exists before the assignment.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

4reactions
dalthvizcommented, Oct 18, 2022

Hi @owillebo thank you for the feedback! This looks like a duplicate of #373 and it was already fixed with #374

Just in case, we are currently checking what other elements could need an update due to PySide6 6.4.0 release at #375 and #376 . For the moment, to prevent this issue, you will need to downgrade PySide 6 to a 6.3.x version.

Let us know if the info above helps!

1reaction
owillebocommented, Nov 8, 2022

Works like a charm!

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to fix attribute Error for module in PyQt5 - Stack Overflow
Try it: import sys from PyQt5 import QtCore, QtGui, QtWidgets # +++ from disptime import Ui_Dialog # * <-> Ui_Dialog #class MyForm(QtGui.
Read more >
AttributeError when creating pyqtgraph plots inside the main ...
However, when I try to run this code, it returns the error: QtGui.QApplication.instance().exec_() AttributeError: 'NoneType' object has no ...
Read more >
PyQt5 vs PyQt6: What are the differences, and is it time to ...
In PyQt6 all enum members must be named using their fully qualified names. This applies to all enums and flags, including those in...
Read more >
Using QGIS plugin default code produces attribute error
Using Windows 10/QGIS 2.18 and QT Designer, I am creating a plugin that will create several random point selections and to place the...
Read more >
qtpy/CHANGELOG.md at master · spyder-ide/qtpy - GitHub
... PySide6 6.4.0 support - AttributeError: Cannot reassign members ... Issue 367 - Import behaviour if no Qt bindings are installed (PR 379 ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found