[英]Pygame.display.init() error: “No available video device”, on VPS Server
I'm trying to run a pygame script on a vps server, and I'm receiving an error on the pygame.display.init()
. 我正在尝试在vps服务器上运行pygame脚本,并且在
pygame.display.init()
上收到错误。
Following the directions found here http://www.pygame.org/docs/ref/display.html#pygame.display.init and in other sources, I used all this configurations before the init(): 按照此处http://www.pygame.org/docs/ref/display.html#pygame.display.init和其他来源中的说明,我在init()之前使用了所有这些配置:
os.environ["SDL_VIDEODRIVER"]="dummy"
os.environ["SDL_VIDEODRIVER"]="x11"
os.environ["SDL_VIDEODRIVER"]="dga"
os.environ["SDL_VIDEODRIVER"]="fbcon"
os.environ["SDL_VIDEODRIVER"]="directfb"
os.environ["SDL_VIDEODRIVER"]="ggi"
os.environ["SDL_VIDEODRIVER"]="vgl"
os.environ["SDL_VIDEODRIVER"]="svgalib"
os.environ["SDL_VIDEODRIVER"]="aalib"
So, the "dummy" option causes the script to go into a loop. 因此,“虚拟”选项使脚本进入循环。 Any other option give me the error:
任何其他选择都会给我错误:
<class 'pygame.error'>: No available video device
I have x11 installed. 我已经安装了x11。 I'm calling the python script from a php file, so, I would expect the graphic output to go inside the browser, or, the "video device" to be set automatically as the user browser.
我正在从php文件中调用python脚本,因此,我希望图形输出进入浏览器,或者将“视频设备”自动设置为用户浏览器。 Not happening.
没有发生。
Are you ssh'd into the vps server? 您是否已进入vps服务器? Have you tried x forwarding,
ssh -X user@server.com
then when you run the script from the command line it should open on your window 您是否尝试过x转发,
ssh -X user@server.com
然后从命令行运行脚本时,它应该在窗口中打开
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.