Python: running pygame through Bash on Ubuntu on Windows

Viewed 6491

I've recently installed and have been playing around with Bash on Ubuntu on Windows. For the most part it works great. I'm trying to run a pygame script through BUW but it doesn't render the graphics in a popup window. Instead, it seems to be contained in the bash window and looks like this:

enter image description here

Is this a lost cause for pygame? Is there anything I can do here to make it run?

3 Answers

Update from 2021: With WSL2 I followed these steps to run PyGame

  1. Download and install Xlaunch. Run it with all default settings except check "Disable access control"

  2. Add the following code to the top of the python file:

import os
os.environ["SDL_VIDEODRIVER"]="x11"
Related