Python spyder 无法初始化 GLX
Python spyder could not initialize GLX
正在尝试设置用于图像处理的桌面站。我最近安装了 ubuntu 16.04,并通过 Adrian 的 guide 安装了 python3、cv2 和虚拟环境。
我没有使用 cv2 3.1.0,而是使用了 cv2 3.2.0,但除此之外,一切都是一样的。
正确安装并运行进行各种测试后,我确认 python3 正常工作并且 cv2 链接到 python。
因为我习惯了图形界面,所以我决定安装 spyder,因为它有一个很好的 GUI 系统。我之前在 2 个不同的设备(一台笔记本电脑和一个 raspberry pi 3)上做过这个。但是,在这台台式计算机上安装后,我 运行 遇到了一个奇怪的问题。
当我 运行 spyder 时,它会导致以下错误
Could not initialize GLX
Aborted (core dumped)
我一直在网上寻找解决方案,但我似乎找不到这个问题的答案
编辑:我在 ubuntu 上搜索核心转储文件,发现一堆文件都包含相同的代码 00000033。
首先,为了我们的理解:
GLX (initialism for "OpenGL Extension to the X Window System") is an
extension to the X Window System core protocol providing an interface
between OpenGL and the X Window System as well as extensions to OpenGL
itself. It enables programs wishing to use OpenGL to do so within a
window provided by the X Window System. GLX distinguishes two
"states": indirect state and direct state.
无论如何,我在安装 QT 时遇到了类似的问题,并通过安装以下软件包解决了它:libgl1-mesa-dri
sudo apt-get install libgl1-mesa-dri
我发现的另一个类似的解决方案是:
sudo apt-get purge nvidia*
sudo cp /etc/X11/xorg.conf /etc/X11/xorg.conf.orig
sudo rm /etc/X11/xorg.conf
对于 32 位,
sudo apt-get install --reinstall xserver-xorg-core libgl1-mesa-glx:i386 libgl1-mesa-dri:i386
对于 64 位
sudo apt-get install --reinstall xserver-xorg-core libgl1-mesa-glx:amd64 libgl1-mesa-dri:amd64
sudo dpkg-reconfigure xserver-xorg
希望对你有所帮助
我遇到了这个问题,当使用 ssh 连接时 spyder 没有启动,我遇到了错误:
Could not initialize GLX.
这是因为 qt 版本是最新的:5.9
我无法通过安装 pyopengl 或我在网上找到的任何其他修复程序来解决它。
简单地安装 qt 5.6.2(使用 conda -c conda-forge)也不起作用,因为它将我的 matplotlib 版本降级到 2.2
我通过重新安装完整的 conda 环境来确保我拥有我想要的 matplotlib 版本:3.1.1
解法:
conda install -c conda-forge matplotlib=3.1 qt=5.6.2 spyder
我有同样的问题,使用 x2go。在尝试了上面提到的所有方法之后,我找到的唯一解决方案是以不同的方式启动 spyder。在此之前,我会这样做(并且它对 spyder 4 非常有效):
source activate [name of your virtual environment]
spyder&
自上周以来,'spyder&' 命令不再启动 IDE,我设法通过编写来超越它:
source activate [name of your virtual environment]
spyder3
终端仍然抱怨某些问题,但至少我现在可以工作了!
我正在 运行ning Ubuntu Raspberry Pi 并且与 Spyder 有同样的问题。
我的原始问题在尝试 运行 spyder 时看起来像这样:
qt.glx: qglx_findConfig: Failed to finding matching FBConfig for QSurfaceFormat(version 2.0, options QFlags<QSurfaceFormat::FormatOption>(), depthBufferSize -1, redBufferSize 1, greenBufferSize 1, blueBufferSize 1, alphaBufferSize -1, stencilBufferSize -1, samples -1, swapBehavior QSurfaceFormat::SingleBuffer, swapInterval 1, colorSpace QSurfaceFormat::DefaultColorSpace, profile QSurfaceFormat::NoProfile)
Could not initialize GLX
Aborted (core dumped)
我尝试了这个线程上的大部分内容,最终能够通过在我尝试 运行 的用户下导出以下变量来使其工作:
export QT_XCB_GL_INTEGRATION=none
这是在涵盖类似问题的 QuteBrowser github 问题线程中发现的:
https://github.com/NixOS/nixpkgs/issues/66755#issuecomment-657305962
正在尝试设置用于图像处理的桌面站。我最近安装了 ubuntu 16.04,并通过 Adrian 的 guide 安装了 python3、cv2 和虚拟环境。
我没有使用 cv2 3.1.0,而是使用了 cv2 3.2.0,但除此之外,一切都是一样的。
正确安装并运行进行各种测试后,我确认 python3 正常工作并且 cv2 链接到 python。
因为我习惯了图形界面,所以我决定安装 spyder,因为它有一个很好的 GUI 系统。我之前在 2 个不同的设备(一台笔记本电脑和一个 raspberry pi 3)上做过这个。但是,在这台台式计算机上安装后,我 运行 遇到了一个奇怪的问题。
当我 运行 spyder 时,它会导致以下错误
Could not initialize GLX
Aborted (core dumped)
我一直在网上寻找解决方案,但我似乎找不到这个问题的答案
编辑:我在 ubuntu 上搜索核心转储文件,发现一堆文件都包含相同的代码 00000033。
首先,为了我们的理解:
GLX (initialism for "OpenGL Extension to the X Window System") is an extension to the X Window System core protocol providing an interface between OpenGL and the X Window System as well as extensions to OpenGL itself. It enables programs wishing to use OpenGL to do so within a window provided by the X Window System. GLX distinguishes two "states": indirect state and direct state.
无论如何,我在安装 QT 时遇到了类似的问题,并通过安装以下软件包解决了它:libgl1-mesa-dri
sudo apt-get install libgl1-mesa-dri
我发现的另一个类似的解决方案是:
sudo apt-get purge nvidia*
sudo cp /etc/X11/xorg.conf /etc/X11/xorg.conf.orig
sudo rm /etc/X11/xorg.conf
对于 32 位,
sudo apt-get install --reinstall xserver-xorg-core libgl1-mesa-glx:i386 libgl1-mesa-dri:i386
对于 64 位
sudo apt-get install --reinstall xserver-xorg-core libgl1-mesa-glx:amd64 libgl1-mesa-dri:amd64
sudo dpkg-reconfigure xserver-xorg
希望对你有所帮助
我遇到了这个问题,当使用 ssh 连接时 spyder 没有启动,我遇到了错误:
Could not initialize GLX.
这是因为 qt 版本是最新的:5.9
我无法通过安装 pyopengl 或我在网上找到的任何其他修复程序来解决它。 简单地安装 qt 5.6.2(使用 conda -c conda-forge)也不起作用,因为它将我的 matplotlib 版本降级到 2.2
我通过重新安装完整的 conda 环境来确保我拥有我想要的 matplotlib 版本:3.1.1
解法:
conda install -c conda-forge matplotlib=3.1 qt=5.6.2 spyder
我有同样的问题,使用 x2go。在尝试了上面提到的所有方法之后,我找到的唯一解决方案是以不同的方式启动 spyder。在此之前,我会这样做(并且它对 spyder 4 非常有效):
source activate [name of your virtual environment]
spyder&
自上周以来,'spyder&' 命令不再启动 IDE,我设法通过编写来超越它:
source activate [name of your virtual environment]
spyder3
终端仍然抱怨某些问题,但至少我现在可以工作了!
我正在 运行ning Ubuntu Raspberry Pi 并且与 Spyder 有同样的问题。
我的原始问题在尝试 运行 spyder 时看起来像这样:
qt.glx: qglx_findConfig: Failed to finding matching FBConfig for QSurfaceFormat(version 2.0, options QFlags<QSurfaceFormat::FormatOption>(), depthBufferSize -1, redBufferSize 1, greenBufferSize 1, blueBufferSize 1, alphaBufferSize -1, stencilBufferSize -1, samples -1, swapBehavior QSurfaceFormat::SingleBuffer, swapInterval 1, colorSpace QSurfaceFormat::DefaultColorSpace, profile QSurfaceFormat::NoProfile)
Could not initialize GLX
Aborted (core dumped)
我尝试了这个线程上的大部分内容,最终能够通过在我尝试 运行 的用户下导出以下变量来使其工作:
export QT_XCB_GL_INTEGRATION=none
这是在涵盖类似问题的 QuteBrowser github 问题线程中发现的: https://github.com/NixOS/nixpkgs/issues/66755#issuecomment-657305962