gpt4 book ai didi

linux - 在 CentOS 7 上运行 Qt 的问题

转载 作者:太空宇宙 更新时间:2023-11-04 09:15:15 26 4
gpt4 key购买 nike

from PyQt5.QtGui import QGuiApplication

app = QGuiApplication([])

启动时报错

qt.qpa.screen: QXcbConnection: Could not connect to display
Could not connect to any X display.

告诉我如何解决这个问题?我找不到它。

最佳答案

看起来 DISPLAY 环境变量未设置。您是从图形 session 中运行它吗?如果您通过 SSH 运行它,则需要使用 X11 转发。

假设它在服务器上启用,您需要使用 -X 选项运行 ssh。

您可以在 ssh man page 上找到更多相关信息.

关于linux - 在 CentOS 7 上运行 Qt 的问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48681196/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com