kitao / pyxel

A retro game engine for Python
MIT License
15.35k stars 847 forks source link

ImportError: libSDL2-2.0.so.0: cannot open shared object file: No such file or directory #502

Closed amalrkc closed 1 year ago

amalrkc commented 1 year ago

pyxel-error Screenshot 2023-11-21 185043

Ubuntu 22.04.2 LTS running on Windows 11 WSL

How do I fix this?

merwok commented 1 year ago

Do you have libsdl2 installed?

amalrkc commented 1 year ago

Ohh My bad! I did not catch that step in the README.

I did install sdl with sudo apt-get install libsdl2-2.0-0 as mentioned here.

The CLI seems to be working but fails run scripts due to some problem with the audio subsystem.

pyxel-error-06 Screenshot 2023-11-24 023830 pyxel-error-07 Screenshot 2023-11-24 024019

I'm not sure if this is a side effect of trying to run scripts on top of Windows WSL.

merwok commented 1 year ago

Probably! I don’t know if WSL is meant for scripts only; working with system resources like audio or inputs would require a translation layer. Question: why not use a windows terminal to run pyxel games on windows?

amalrkc commented 1 year ago

Okay, there was something broken with my Python installation on Windows.

The Python interpreter was working fine, but for some reason pip was not installed.

No matter how many I reinstalled or repaired my Python installation, I simply couldn't get it to work, which is why I decided to to try Ubuntu.

After trying py -m ensurepip --upgrade and py -m pip install -U pip as mentioned here, I finally got it installed and working.

But even after that I couldn't properly install Pyxel and couple of errors kept showing up.

Turns out, running Windows Terminal as Administrator and then using pip solves the problem

PS: It would be nice to run Pyxel as a Single Binary Executable without needing to install dependencies, like TIC-80 and PICO-8.