是否可以使用WSL和Jupyter Lab从pygame运行游戏?

问题描述 投票:1回答:1

我正在尝试从WSL(Debian)上的github存储库运行Mario Kart克隆,但我的WSL不包括X11。因此,我想知道是否有可能从Jupyter实验室启动它。当我尝试启动它时,出现错误:

pygame 1.9.6
Hello from the pygame community. https://www.pygame.org/contribute.html
ALSA lib confmisc.c:767:(parse_card) cannot find card '0'
ALSA lib conf.c:4568:(_snd_config_evaluate) function snd_func_card_driver returned error: No such file or directory
ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings
ALSA lib conf.c:4568:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1246:(snd_func_refer) error evaluating name
ALSA lib conf.c:4568:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5047:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM default
Traceback (most recent call last):
  File "MarioKart.pyw", line 14, in <module>
    screen = pygame.display.set_mode(MENU_DIMENSIONS)
pygame.error: No available video device

github回购:https://github.com/s4rd0n1k/pygame_mariokart

pygame windows-subsystem-for-linux jupyter-lab
1个回答
0
投票

您的直接问题是一个合理的问题。这应该通过

来解决

export SDL_AUDIODRIVER ='dsp'

或者在Jupyter Lab中设置环境变量所需的任何条件。

除此之外,我不知道这些图形是否可以工作。

© www.soinside.com 2019 - 2024. All rights reserved.