Python PyQt5.qtwidts.QApplication在更新到mojave后崩溃,出现缺少cocoa插件错误

Python PyQt5.qtwidts.QApplication在更新到mojave后崩溃,出现缺少cocoa插件错误,python,qt,cocoa,pyqt,pyqt5,Python,Qt,Cocoa,Pyqt,Pyqt5,由于将macbook更新为mojave,我无法在python2.7中创建QApplication对象 Python 2.7.15 (default, Jan 9 2019, 18:18:40) [GCC 4.2.1 Compatible Apple LLVM 10.0.0 (clang-1000.11.45.5)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>

由于将macbook更新为mojave,我无法在python2.7中创建QApplication对象

Python 2.7.15 (default, Jan  9 2019, 18:18:40) 
[GCC 4.2.1 Compatible Apple LLVM 10.0.0 (clang-1000.11.45.5)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from PyQt5 import QtWidgets
>>> _app = QtWidgets.QApplication(['any'])
qt.qpa.plugin: Could not find the Qt platform plugin "cocoa" in ""
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Abort trap: 6
我尝试重新安装python和pyqt(使用自制),我确保自制是最新的,并修复了brew doctor中所有缺失的依赖项(有一些警告,但它们似乎不相关)


我想我错过了这个cocoa插件(我不知道它是干什么用的),但我不知道从哪里安装它。我发现了一些类似的问题,但它们似乎与构建应用程序有关——我不确定如何将这些修复应用于在python内部运行QApplication。

您看过这些问题吗?您看到了吗:Qt平台插件丢失了?通用的解决方案是:
export QT\u QPA\u PLATFORM\u PLUGIN\u PATH=/QtPath/plugins/platforms
,然后从该上下文调用可执行文件。