Pygame headless setup

后端 未结 1 859
北荒
北荒 2021-01-18 03:57

I am using pygame\'s joystick api to use a joystick with my project on a headless system, but pygame requires a \"screen\" so I have setup a dummy video system to over come

相关标签:
1条回答
  • 2021-01-18 04:51

    Pygame is trying to open a console which means you're running this script through ssh or cron or somewhere else that doesn't have access to the console. I would try skipping set_mode (since the dummy driver likely doesn't have modes to set) and just try to initialize the display. You can try running it as root which might give it access. You can also try telling it to use fbcon.

    os.putenv('SDL_VIDEODRIVER', 'fbcon')
    pygame.display.init()
    
    0 讨论(0)
提交回复
热议问题