我正在尝试使用Spyder 3.2.8 PySide2和macOS 10.13.4中的Anaconda中的Python 3.6.4运行应用程序。
尝试N°1
在看过这个stackoveflow页面和这个github页面后,我在Python > Preferences > IPython Console > Graphics中将我的图形后端从Inline更改为Automatic ,我尝试运行以下脚本( 脚本N°1 ):
脚本编号1
import sys
from PySide2.QtWidgets import *
# Create a Qt application
app = QApplication.instance()
if app is None:
print("print something")
app = QApplication(sys.argv)
# Create a Label and show it
label = QLabel("Hello World")
label.show()
# Enter Qt application main loop
app.exec_()
但运行后收到以下错误消息:
Importing PySide2 disabled by IPython, which has
already imported an Incompatible QT Binding: pyqt5
这里有类似的matplotlib报告问题, 这里有ipython,但它没有帮助我(或者我无法正确实现)。 然后我尝试通过以下方式更改脚本N°1来实现此页面关于qtpy的内容:
脚本编号2
impo