Ubuntu-25.04 Wayland桌面环境安装Anaconda3之后无法启动anaconda-navigator问题解决

目录

  • [1. 问题描述](#1. 问题描述)
  • [2. 解决方案](#2. 解决方案)
  • [3. References](#3. References)

1. 问题描述

在命令行中尝试启动anaconda-navigator图形界面,报错:

sh 复制代码
albertqee@ZBG7W:~$ anaconda-navigator 
Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway.
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)
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)
albertqee@ZBG7W:~$

上述报错提示桌面环境为Wayland,且无法完成GLX初始化操作。

检查GLX信息如下:

sh 复制代码
albertqee@ZBG7W:~$ glxinfo | egrep -i opengl
OpenGL vendor string: Intel
OpenGL renderer string: Mesa Intel(R) UHD Graphics (CML GT2)
OpenGL core profile version string: 4.6 (Core Profile) Mesa 25.0.3-1ubuntu2
OpenGL core profile shading language version string: 4.60
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL core profile extensions:
OpenGL version string: 4.6 (Compatibility Profile) Mesa 25.0.3-1ubuntu2
OpenGL shading language version string: 4.60
OpenGL context flags: (none)
OpenGL profile mask: compatibility profile
OpenGL extensions:
OpenGL ES profile version string: OpenGL ES 3.2 Mesa 25.0.3-1ubuntu2
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20
OpenGL ES profile extensions:
albertqee@ZBG7W:~$ 

并无异常,查看conda的QT信息:

sh 复制代码
albertqee@ZBG7W:~$ conda list | egrep -i qt
aws-c-mqtt                0.7.13               h5eee18b_0  
pyqt                      5.15.10         py312h6a678d5_0  
pyqt5-sip                 12.13.0         py312h5eee18b_0  
pyqtwebengine             5.15.10         py312h6a678d5_0  
qt-main                   5.15.2              h53bd1ea_10  
qt-webengine              5.15.9               h9ab4d14_7  
qtawesome                 1.3.1           py312h06a4308_0  
qtconsole                 5.5.1           py312h06a4308_0  
qtpy                      2.4.1           py312h06a4308_0  
sphinxcontrib-qthelp      1.0.3              pyhd3eb1b0_0  
albertqee@ZBG7W:~$ conda list pyqt
# packages in environment at /home/albertqee/anaconda3:
#
# Name                    Version                   Build  Channel
pyqt                      5.15.10         py312h6a678d5_0  
pyqt5-sip                 12.13.0         py312h5eee18b_0  
pyqtwebengine             5.15.10         py312h6a678d5_0  
albertqee@ZBG7W:~$

2. 解决方案

使用conda命令安装Wayland渲染架构的基础库[1],具体如下:

sh 复制代码
albertqee@ZBG7W:~$  conda install conda-forge::wayland 
Retrieving notices: done
Channels:
 - conda-forge
 - defaults
Platform: linux-64
Collecting package metadata (repodata.json): done
Solving environment: done

## Package Plan ##

  environment location: /home/albertqee/anaconda3

  added / updated specs:
    - conda-forge::wayland


The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    expat-2.7.0                |       h5888daf_0         137 KB  conda-forge
    libexpat-2.7.0             |       h5888daf_0          73 KB  conda-forge
    libffi-3.4.6               |       h2dba641_1          56 KB  conda-forge
    libstdcxx-15.1.0           |       h8f9b012_3         3.7 MB  conda-forge
    wayland-1.24.0             |       h3e06ad9_0         323 KB  conda-forge
    ------------------------------------------------------------
                                           Total:         4.3 MB

The following NEW packages will be INSTALLED:

  libstdcxx          conda-forge/linux-64::libstdcxx-15.1.0-h8f9b012_3 
  wayland            conda-forge/linux-64::wayland-1.24.0-h3e06ad9_0 

The following packages will be UPDATED:

  expat                   pkgs/main::expat-2.6.3-h6a678d5_0 --> conda-forge::expat-2.7.0-h5888daf_0 
  libexpat                                 2.6.3-h5888daf_0 --> 2.7.0-h5888daf_0 
  libffi                 pkgs/main::libffi-3.4.4-h6a678d5_1 --> conda-forge::libffi-3.4.6-h2dba641_1 


Proceed ([y]/n)? y


Downloading and Extracting Packages:
                                                                                                                                                                                              
Preparing transaction: done                                                                                                                                                                   
Verifying transaction: done                                                                                                                                                                   
Executing transaction: done                                                                                                                                                                   
albertqee@ZBG7W:~$             

安装完成之后,再次启动anaconda-navigator即可。

sh 复制代码
albertqee@ZBG7W:anaconda3$ source ~/anaconda3/bin/activate
(base) albertqee@ZBG7W:anaconda3$ anaconda-navigator
Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway.

界面如下图:

3. References

1\]. [conda-forge/wayland](https://anaconda.org/conda-forge/wayland)

相关推荐
Source.Liu21 小时前
【学Python自动化】 8.1 Python 与 Rust 错误处理对比学习笔记
python·rust·自动化
守.护1 天前
云计算学习笔记——Linux系统网络配置与远程管理(ssh)篇
linux·运维·服务器·ssh·linux网络配置
计算机毕业设计木哥1 天前
计算机Python毕业设计推荐:基于Django的酒店评论文本情感分析系统【源码+文档+调试】
开发语言·hadoop·spring boot·python·spark·django·课程设计
BYSJMG1 天前
基于Python毕业设计推荐:基于Django的全国降水分析可视化系统
hadoop·python·django·vue·毕业设计·课程设计·毕设
津津有味道1 天前
15693协议ICODE SLI 系列标签应用场景说明及读、写、密钥认证操作Qt c++源码,支持统信、麒麟等国产Linux系统
linux·c++·qt·icode·sli·15693
飞天小蜈蚣1 天前
python - ( js )object对象、json对象、字符串对象的相关方法、数组对象的相关方法、BOM对象、BOM模型中 Navigator 对象
javascript·python·json
Lynnxiaowen1 天前
今天我们继续学习shell编程语言的内容
linux·运维·学习·云计算·bash
云手机掌柜1 天前
Twitter舆情裂变链:指纹云手机跨账号协同机制提升互动率200%
python·网络安全·智能手机·矩阵·虚幻·内容运营·twitter
2401_897930061 天前
python 创建websocket教程
开发语言·python·websocket
AI Echoes1 天前
LangGraph 重要注意事项和常见问题
人工智能·python·langchain·agent