小编Ded*_*dUV的帖子

导入错误:未找到符号:macOS Sierra 10.12.6 中使用 PyQT5 _futimens

所以,我正在尝试运行基本代码:

from PyQt5.QtWidgets import QMainWindow, QPushButton, QApplication
import sys

class Example(QMainWindow):
    def __init__(self):
        super().__init__()
        btn = QPushButton("Hello World!", self)
        btn.move(50,75)
        self.setGeometry(100, 100, 200,150)
        self.setWindowTitle('PyQt Window')
        self.show()

if __name__ == '__main__':
    app = QApplication(sys.argv)
    ex = Example()
    sys.exit(app.exec_())
Run Code Online (Sandbox Code Playgroud)

并且不断出现这个错误:

ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/PyQt5/QtWidgets.abi3.so, 2): Symbol not found: _futimens
  Referenced from: /Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/PyQt5/Qt/lib/QtCore.framework/Versions/5/QtCore (which was built for Mac OS X 10.13)
  Expected in: /usr/lib/libSystem.B.dylib
 in /Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/PyQt5/Qt/lib/QtCore.framework/Versions/5/QtCore
Run Code Online (Sandbox Code Playgroud)

我正在使用 Python 3.8,并使用“pip3 install pyqt5”安装了 PyQT5。我尝试使用自制软件,但它不起作用,因为我有一个超级旧版本的 macOS。到目前为止,我最多只使用过 SQLite Studio,没有出现任何问题。(所以,是的,这里是超级初学者)。有什么解决办法吗?

python importerror symbol-not-found pyqt5 macos-sierra

5
推荐指数
1
解决办法
3123
查看次数