PyCharm 对 M1 上 PyQt6 的支持

发布于 2025-01-14 12:41:59 字数 763 浏览 2 评论 0原文

我现在已经切换到 Pycharm 和 PyQt5,因为它可以更好地支持集成。

我们学校刚刚升级到 M1 芯片,现在我的解决方案不起作用。

我可以下载最新版本的python 3.10.2。

然后我在终端中运行以下命令。

Python3.10.2 -m pip install PyQt6

为了测试代码,我将以下内容输入到空闲中:

import sys

from PyQt6 import QtWidgets

app = QtWidgets.QApplication(sys.argv)

widget = QtWidgets.QWidget()
widget.resize(400, 200)

widget.setWindowTitle("This is PyQt Widget example")

widget.show()

exit(app.exec())

这一切都运行良好,并且将显示一个窗口。

然后我打开 Pycharm 2021.3 社区版。

选择相同的解释器并加载全局依赖项。

我运行它,然后这是我得到的错误

Error in Pycharm

据我所知 PyQt6 支持 Arm 和 86来自同一下载源的架构。是否可以强制解释器仅使用手臂,或者 PyCharm 是否知道凭直觉执行此操作?

我试图让学生首先使用 QT 设计器的拖放构建器。

I've now swapped over to Pycharm and PyQt5 as it had better support an integration.

Our school has just upgraded to M1 chips and now my solution doesn't work.

I can download the latest version of python 3.10.2.

I then run the following command in terminal.

Python3.10.2 -m pip install PyQt6

To test the code I then type this into idle:

import sys

from PyQt6 import QtWidgets

app = QtWidgets.QApplication(sys.argv)

widget = QtWidgets.QWidget()
widget.resize(400, 200)

widget.setWindowTitle("This is PyQt Widget example")

widget.show()

exit(app.exec())

This all works perfectly and a window will be displayed.

I then open up Pycharm 2021.3 community edition.

Select the same interpreter and load global dependencies.

I run it and then this is the error I get

Error in Pycharm

From what I can read PyQt6 supports both the Arm and 86 architecture from the same download source. Is it possible to force an interpreter to use just the arm or does PyCharm know to do this intuitively?

I'm trying to get students to use the drop and drag builder with QT designer first.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文