Anaconda和python qt5.6和opengl supp

2024-06-01 07:12:55 发布

您现在位置:Python中文网/ 问答频道 /正文

我在试图让我的应用程序在Python环境中使用pythonqt5.6时遇到了大量问题。在

我用conda包安装在:https://anaconda.org/anaconda/pyqt

列出anaconda环境显示,我只将qt 5.6安装为:

pyqt                      5.6.0                    py27_0    anaconda
qt                        5.6.0                         1    anaconda

现在,我有一个简单的应用程序:

^{pr2}$

qml文件示例如下:

import QtQuick 2.0

Rectangle {
    width: 300; height: 100
    color: "gray"

    Text {
        id: helloworld
        text: "Hello world!"
        color: "blue"
        font.pointSize: 32
    }
}

现在,我调用它得到以下错误:

QXcbIntegration: Cannot create platform OpenGL context, neither GLX nor EGL are enabled
QXcbIntegration: Cannot create platform OpenGL context, neither GLX nor EGL are enabled
Failed to create OpenGL context for format QSurfaceFormat(version 2.0, options QFlags(), depthBufferSize 24, redBufferSize -1, greenBufferSize -1, blueBufferSize -1, alphaBufferSize -1, stencilBufferSize 8, samples -1, swapBehavior 2, swapInterval 1, profile  0) 
Aborted (core dumped)

Tags: 应用程序环境createcontextanacondaqtpyqtcolor