qtpy import overrides pyqt5 import
See original GitHub issueProblem Description
It seems that starting spyder and running code in the interactive console overrides imports of pyqt
. This can lead to strange issues when running the code somewhere else even using the same environment. In the description below, this is assumed, e.g. running either in spyder interactive terminal or running using ipython
from the same environment (where python
can be used to reproduce too)
Sample, works:
from qtpy import QtCore
QtCore.Signal()
Sample 2, works:
from pyqt5 import QtCore
QtCore.pyqtSignal()
Sample 3, fails in cmd, works in spyder:
from pyqt5 import QtCore
QtCore.Signal()
What steps reproduce the problem?
- Run the sample 3 in spyder using F5
- Run the sample 3 from cmd
- Signal / Slot import will either fail or work.
What is the expected output? What do you see instead?
This is due the override of pyqtSignal
with Signal
in qtpy.QtCore
I guess. I just dont see this being a consistent bevavior or I dont understand the reasoning.
Paste Traceback/Error Below (if applicable)
Import error due to Signal
has been moved to pyqtSignal
in pyqt5+
Issue Analytics
- State:
- Created 2 years ago
- Comments:8 (5 by maintainers)
Top Results From Across the Web
Overriding paintEvent in PyQt5 and PySide2 - Stack Overflow
I never had this problem in Qt4. from PySide2 import QtWidgets, QtCore, QtGui # use pyside # from PyQt5 import QtWidgets, QtCore, QtGui...
Read more >Help overwriting a PyQT widget class and adding a ... - Qt Forum
I'm trying to create my own "ComboBox" class that inherits the QCombobox widget so I can overwrite and specifically control the pop up ......
Read more >How to Import a PyQt5 .ui File in a Python GUI - Nitratine
In this tutorial, I am going to cover a method that allows you to import the .ui file generated by PyQt Designer directly...
Read more >[PyQt] Overriding QStandardItem with __iter__ in PyQt5
... QT/PyQT5 versions: 5.6 Thank you for your time, t. from PyQt5 import (Qt, QtCore, QtGui, QtWidgets) from sip import SIP_VERSION import ......
Read more >PyQt5 QSpinBox - How to override the flags - GeeksforGeeks
For example if user set Qt.CoverWindow flag to spin box, ... from PyQt5 import QtCore, QtGui ... overriding the spin box's window flags....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I will double check bot not that I know of. Strange… I will check my virtualenv maybe something is mixed up there
Closing due to lack of response. @max3-2, I hope you were able to solve this issue.