PyGame 问题 - libGL 错误:无法加载驱动程序:swrast

PyGame 问题 - libGL 错误:无法加载驱动程序:swrast

我正在接近pygame现在,我正在运行一个小程序,它打开一个 pygame 窗口并显示一个介绍,这是一个带有背景和两个按钮的简单屏幕(只有当鼠标悬停在其上时它们才会亮起)。

当我运行代码时显示以下终端错误:

Hello from the pygame community. https://www.pygame.org/contribute.html
[ WARN:0] global /tmp/pip-req-build-driubr42/opencv/modules/videoio/src/cap_v4l.cpp (890) open VIDEOIO(V4L2:/dev/video1): can't open camera by index
libGL error: MESA-LOADER: failed to open crocus: /usr/lib/dri/crocus_dri.so: cannot open shared object file: No such file or directory (search paths /usr/lib/x86_64-linux-gnu/dri:\$${ORIGIN}/dri:/usr/lib/dri, suffix _dri)
libGL error: failed to load driver: crocus
libGL error: MESA-LOADER: failed to open swrast: /usr/lib/dri/swrast_dri.so: cannot open shared object file: No such file or directory (search paths /usr/lib/x86_64-linux-gnu/dri:\$${ORIGIN}/dri:/usr/lib/dri, suffix _dri)
libGL error: failed to load driver: swrast
X Error of failed request:  BadValue (integer parameter out of range for operation)
  Major opcode of failed request:  149 (GLX)
  Minor opcode of failed request:  3 (X_GLXCreateContext)
  Value in failed request:  0x0
  Serial number of failed request:  105
  Current serial number in output stream:  106

从我读到的来看,这似乎是视频驱动程序的问题,我有Mesa 英特尔® 高清显卡 4600 (HSW GT2), 和我的Ubuntu 版本是 21.10。我的笔记本电脑戴尔 LATITUDE E6440Intel® Core™ i5-4300M CPU @ 2.60GHz × 4

有人可以帮帮我吗??

答案1

我在没有显卡的 manjaro amd64 上使用 miniconda。在 conda env py3.7 中出现此错误。我关闭了 env use system 来玩 pygame。一切正常

相关内容