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

從我的閱讀來看,它看起來像是視頻驅動程式問題,我有梅薩英特爾® 高畫質顯示卡 4600 (HSW GT2), 和我的Ubuntu版本是21.10。我的筆記型電腦是戴爾緯度 E6440英特爾® 酷睿™ i5-4300M CPU @ 2.60GHz × 4

有人可以幫我嗎?

答案1

我在 manjaro amd64 上使用 miniconda,沒有顯示卡。在 conda env py3.7 中出現此錯誤。我關閉 env use system 來玩 pygame。效果很好

相關內容