Ubuntu 17.10 / Running from Source: Dependency issues

Issue #67 new
Former user created an issue

Hello!

I don't know much about python and may have been doing things The Wrong Way, so please take this from a user's perspective.

I've been trying to install playscii from source, or rather, get it to run on the latest Ubuntu. First thing I did after unzipping was to install the dependencies via pip:

$ pip3 install -r requirements.txt
[...]
Successfully installed Pillow-2.9.0 PyOpenGL-3.1.0 PySDL2-0.9.3 appdirs-1.4.0 gprof2dot-2015.12.1 numpy-1.9.2

Trying to run Playscii resulted in the following error:

$ ./playscii_linux.sh 
Traceback (most recent call last):
  File "/home/user/.local/lib/python3.6/site-packages/sdl2/sdlmixer.py", line 54, in <module>
    os.getenv("PYSDL2_DLL_PATH"))
  File "/home/user/.local/lib/python3.6/site-packages/sdl2/dll.py", line 53, in __init__
    (libinfo, dllmsg))
RuntimeError: could not find any library for SDL2_mixer (PYSDL2_DLL_PATH: unset)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "playscii.py", line 29, in <module>
    from sdl2 import video, sdlmixer
  File "/home/user/.local/lib/python3.6/site-packages/sdl2/sdlmixer.py", line 56, in <module>
    raise ImportError(exc)
ImportError: could not find any library for SDL2_mixer (PYSDL2_DLL_PATH: unset)

I gathered that the version of SDL2 installed via pip wasn't detected for some reason (running pip with sudo resulted in errors as well). After installing the (system-wide) python3-sdl2 package via apt, I was getting a different error:

$ ./playscii_linux.sh 
Playscii v0.9.8
Created new config file /home/user/.config/Playscii/playscii.cfg
Detecting hardware...
  CPU: x86_64
  OS: Linux-4.13.0-16-generic-x86_64-with-Ubuntu-17.10-artful
  Python: 3.6.3 (default, Oct  3 2017, 21:45:48)  [GCC 7.2.0] (64bit)
Traceback (most recent call last):
  File "playscii.py", line 1090, in <module>
    state_to_load, autoplay_game)
  File "playscii.py", line 203, in __init__
    module_versions += 'PIL: %s' % PIL.__version__
AttributeError: module 'PIL' has no attribute '__version__'
$ pip3 install PIL
Collecting PIL
  Could not find a version that satisfies the requirement PIL (from versions: )
No matching distribution found for PIL

The python3-pil package was already installed on my system. After googling for errors and trying to install PIL via pip I noticed a package called Pillow-PIL:

$ pip3 search PIL 
[...]
Pillow-PIL (0.1dev)                                  - Pillow wrapper for PIL compatibility
[...]

After installing that one I was finally able to run and use Playscii:

$ pip3 install Pillow-PIL
[...]
Successfully built Pillow-PIL olefile
Installing collected packages: olefile, Pillow, Pillow-PIL
Successfully installed Pillow-4.3.0 Pillow-PIL-0.1.dev0 olefile-0.44

$ ./playscii_linux.sh 
Playscii v0.9.8
Loading config from /home/user/.config/Playscii/playscii.cfg...
Config loaded.
Detecting hardware...
  [...]
Loaded key binds from /home/user/.config/Playscii/binds.cfg
init done.

I hope this helps.

Comments (3)

  1. JP LeBreton repo owner

    Hmm, so this seems like something I could fix just by adding notes to the docs section about running from source? I just realized SDL2-mixer is often not included with SDL2 / pysdl2, so maybe I should add a note that you need to install that seperately. As for the Pillow vs Pillow-PIL issue, that's totally baffling. I don't have access to a normal Ubuntu system right now, but I was going to reinstall it on my laptop soon and I'll see what the running-from-scratch experience is like on that.

  2. Benjamin

    I have the same issues with Arch Linux In the end I just commented out all the sdlmixer lines - there's no need for audio I figure, not for me anyway. Works fine now with pip installed pysdl2

  3. Log in to comment