有在 M2 MacOS 下使用 pyside6 的朋友吗? pyside6-designer 疯狂崩溃

341 天前
 goodspb

当我打开界面创建了一个 MainWindows 之后,每当我点击 MainWindow 的时候,就会崩溃。

python3.9 使用 pip install 安装的 pyside6

错误日志:

Error: qt.pysideplugin: Environment variable PYSIDE_DESIGNER_PLUGINS is not set, bailing out.
qt.pysideplugin: No instance of QPyDesignerCustomWidgetCollection was found.
Qt Designer: The QWebEngineView custom widget plugin is disabled because it requires OpenGL/Software RHI (current: 6).
Qt Designer: The QWebEngineView custom widget plugin is disabled because it requires OpenGL/Software RHI (current: 6).
QtLocalePropertyManager::valueText: Unknown territory 50 for English
2023-07-23 17:10:24.920 Designer[44759:1878516] *** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[__NSArrayM objectAtIndexedSubscript:]: index 2 beyond bounds for empty array'
*** First throw call stack:
(
	0   CoreFoundation                      0x000000019617f154 __exceptionPreprocess + 176
	1   libobjc.A.dylib                     0x0000000195c9e4d4 objc_exception_throw + 60
	2   CoreFoundation                      0x00000001962699b8 -[__NSCFString characterAtIndex:].cold.1 + 0
	3   CoreFoundation                      0x00000001960f2bb8 -[__NSArrayM objectAtIndexedSubscript:] + 188
	4   libqcocoa.dylib                     0x00000001046f8124 _ZN20QCocoaSystemTrayIcon13emitActivatedEv + 269336
	5   libqcocoa.dylib                     0x00000001046f81a8 _ZN20QCocoaSystemTrayIcon13emitActivatedEv + 269468
	6   libqcocoa.dylib                     0x00000001046f677c _ZN20QCocoaSystemTrayIcon13emitActivatedEv + 262768
	7   QtWidgets                           0x0000000104ba9354 _ZN9QTreeView16selectionChangedERK14QItemSelectionS2_ + 620
	8   QtCore                              0x0000000105a29788 _ZN11QMetaObject8activateEP7QObjectPKS_iPPv + 3780
	9   QtCore                              0x0000000105bed6a4 _ZN19QItemSelectionModel20emitSelectionChangedERK14QItemSelectionS2_ + 216
	10  QtCore                              0x0000000105bed264 _ZN19QItemSelectionModel6selectERK14QItemSelection6QFlagsINS_13SelectionFlagEE + 660
	11  QtCore                              0x0000000105bede2c _ZN19QItemSelectionModel14clearSelectionEv + 64
	12  QtDesignerComponents                0x00000001036b2354 QtDesignerComponents + 451412
	13  QtDesignerComponents                0x000000010366f5b8 QtDesignerComponents + 177592
	14  QtDesignerComponents                0x0000000103682c64 QtDesignerComponents + 257124
	15  QtCore                              0x00000001059e0138 _ZN23QCoreApplicationPrivate34sendThroughApplicationEventFiltersEP7QObjectP6QEvent + 228
	16  QtWidgets                           0x00000001048bcf2c _ZN19QApplicationPrivate13notify_helperEP7QObjectP6QEvent + 80
	17  QtWidgets                           0x00000001048bf03c _ZN12QApplication6notifyEP7QObjectP6QEvent + 5100
	18  QtCore                              0x00000001059dff88 _ZN16QCoreApplication15notifyInternal2EP7QObjectP6QEvent + 292
	19  QtWidgets                           0x00000001048bd58c _ZN19QApplicationPrivate14sendMouseEventEP7QWidgetP11QMouseEventS1_S1_PS1_R8QPointerIS0_Ebb + 808
	20  QtWidgets                           0x000000010491a9b0 _ZNK21QWidgetRepaintManager3rhiEv + 9912
	21  QtWidgets                           0x0000000104919c68 _ZNK21QWidgetRepaintManager3rhiEv + 6512
	22  QtWidgets                           0x00000001048bcfec _ZN19QApplicationPrivate13notify_helperEP7QObjectP6QEvent + 272
	23  QtWidgets                           0x00000001048bde50 _ZN12QApplication6notifyEP7QObjectP6QEvent + 512
	24  QtCore                              0x00000001059dff88 _ZN16QCoreApplication15notifyInternal2EP7QObjectP6QEvent + 292
	25  QtGui                               0x0000000103d6e794 _ZN22QGuiApplicationPrivate17processMouseEventEPN29QWindowSystemInterfacePrivate10MouseEventE + 1748
	26  QtGui                               0x0000000103dc5aa4 _ZN22QWindowSystemInterface22sendWindowSystemEventsE6QFlagsIN10QEventLoop17ProcessEventsFlagEE + 396
	27  libqcocoa.dylib                     0x000000010469bd40 qt_plugin_instance + 54740
	28  CoreFoundation                      0x000000019610663c __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 28
	29  CoreFoundation                      0x00000001961065d0 __CFRunLoopDoSource0 + 176
	30  CoreFoundation                      0x0000000196106340 __CFRunLoopDoSources0 + 244
	31  CoreFoundation                      0x0000000196104f48 __CFRunLoopRun + 828
	32  CoreFoundation                      0x00000001961044b8 CFRunLoopRunSpecific + 612
	33  HIToolbox                           0x000000019f94ec40 RunCurrentEventLoopInMode + 292
	34  HIToolbox                           0x000000019f94e8d0 ReceiveNextEventCommon + 220
	35  HIToolbox                           0x000000019f94e7d4 _BlockUntilNextEventMatchingListInModeWithFilter + 76
	36  AppKit                              0x0000000199325d44 _DPSNextEvent + 636
	37  AppKit                              0x0000000199324ee0 -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 716
	38  AppKit                              0x0000000199319344 -[NSApplication run] + 464
	39  libqcocoa.dylib                     0x000000010469a644 qt_plugin_instance + 48856
	40  QtCore                              0x00000001059e98fc _ZN10QEventLoop4execE6QFlagsINS_17ProcessEventsFlagEE + 532
	41  QtCore                              0x00000001059e0614 _ZN16QCoreApplication4execEv + 112
	42  Designer                            0x0000000102cb99b8 main + 104
	43  dyld                                0x0000000195ccff28 start + 2236
)
libc++abi: terminating due to uncaught exception of type NSException

while executing '/Users/xxxx/py-src/test_pyside6/venv/lib/python3.9/site-packages/PySide6/Designer.app/Contents/MacOS/Designer'

Process finished with exit code 250

就是图中的红色部分:

1293 次点击
所在节点    Python
4 条回复
NoOneNoBody
341 天前
because it requires OpenGL/Software RHI (current: 6)

这句写了原因了,非 mac 用户,所以不知道系统是否支持

qt.pysideplugin: No instance of QPyDesignerCustomWidgetCollection was found.
看样子要装插件,你再去搜搜文章找解决办法,关键字带上系统
Oilybear
341 天前
以前有遇到过,我记得装的 designer 好像是 pyside2 的,我的建议找个 win 的机器设计 UI 就好,mac 的 designer 窗口都没设计到一起,太反人类了
goodspb
340 天前
@NoOneNoBody
@Oilybear

感谢感谢,最后还是得下载个 QT Creator 用里面的 designer 才可以。太折腾了,感觉 pyside 这块不是很友好(或者只是我不懂 😭
Andywoo
233 天前
designer 确实不好用,我都是手码界面😭

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/959000

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX