Python: Running Pygame Through Bash On Ubuntu On Windows
Solution 1:
Pygame runs on SDL. The SDL version shipped with ubuntu requires* an xserver to run. Find out how to run an xserver with bash on ubuntu on windows.
This question might provide those steps: How to use X Windows with Emacs on Windows 10 Bash?
*It requires something to render to, raw framebuffers and,as you noticed, libcaca, which renders bitmaps to ascii art, are also fine. Rendering to X is the one you probably want, though.
Solution 2:
From the FAQ on the page you linked to:
Can I run ALL Linux apps in WSL?
No! WSL is a tool aimed at enabling users who need them to run Bash and core Linux command-line tools on Windows.
WSL does not aim to support GUI desktops or applications (e.g. Gnome, KDE, etc.)
Solution 3:
Update from 2021: With WSL2 I followed these steps to run PyGame
Download and install Xlaunch. Run it with all default settings except check "Disable access control"
Add the following code to the top of the python file:
import osos.environ["SDL_VIDEODRIVER"]="x11"
Post a Comment for "Python: Running Pygame Through Bash On Ubuntu On Windows"