openstenoproject / plover

Open source stenotype engine
http://opensteno.org/plover
GNU General Public License v2.0
2.32k stars 281 forks source link

Installation of plugings fails #1108

Closed davidedelvento closed 4 years ago

davidedelvento commented 4 years ago

Summary

I am trying to install plover-midi4text inside (not sure inside is the right word) plover's AppImage and it fails with No such file or directory: 'pkg-config'

Reproducing

Open plugins manager, select plover-midi4text and click Install/Update button. It will spit out the following traceback. Note that there is no user "travis" on this machine, not sure where that comes from (probably AppImage itself?)

Collecting plover-midi4text==0.0.4
  Downloading https://files.pythonhosted.org/packages/40/06/9ffaf3509e803d623e9f83e9cd700439fbf130c8fa3b5ec37d6423fe7e55/plover_midi4text-0.0.4-py3-none-any.whl (713kB)
Requirement not upgraded as not directly required: plover>=4.0.0.dev7 in /tmp/.mount_6ms4AB/usr/lib/python3.6/site-packages (from plover-midi4text==0.0.4)
Collecting plover-midi>=0.2.6 (from plover-midi4text==0.0.4)
  Downloading https://files.pythonhosted.org/packages/02/80/256c2653192cbf907a01db501da7bff26e842c4905abc8029eac7e309be8/plover_midi-0.2.6-py3-none-any.whl
Requirement not upgraded as not directly required: python-xlib>=0.16; "linux" in sys_platform in /tmp/.mount_6ms4AB/usr/lib/python3.6/site-packages (from plover>=4.0.0.dev7->plover-midi4text==0.0.4)
Requirement not upgraded as not directly required: appdirs>=1.3.0 in /tmp/.mount_6ms4AB/usr/lib/python3.6/site-packages (from plover>=4.0.0.dev7->plover-midi4text==0.0.4)
Requirement not upgraded as not directly required: wcwidth in /tmp/.mount_6ms4AB/usr/lib/python3.6/site-packages (from plover>=4.0.0.dev7->plover-midi4text==0.0.4)
Requirement not upgraded as not directly required: pyserial>=2.7 in /tmp/.mount_6ms4AB/usr/lib/python3.6/site-packages (from plover>=4.0.0.dev7->plover-midi4text==0.0.4)
Requirement not upgraded as not directly required: setuptools in /tmp/.mount_6ms4AB/usr/lib/python3.6/site-packages (from plover>=4.0.0.dev7->plover-midi4text==0.0.4)
Collecting python-rtmidi>=1.1.0 (from plover-midi>=0.2.6->plover-midi4text==0.0.4)
  Downloading https://files.pythonhosted.org/packages/31/71/a550e9f30e04ab3f03c1a1c044d828c4fb3d5f72ea04f53e569bc6ac764f/python-rtmidi-1.4.0.tar.gz (243kB)
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-ip9pii74/python-rtmidi/setup.py", line 142, in <module>
        check_for_jack(define_macros, libraries)
      File "/tmp/pip-build-ip9pii74/python-rtmidi/setup.py", line 42, in check_for_jack
        res = subprocess.check_output(['pkg-config', '--modversion', 'jack'])
      File "/home/travis/build/openstenoproject/plover/build/appimage/plover.AppDir/usr/lib/python3.6/subprocess.py", line 336, in check_output
      File "/home/travis/build/openstenoproject/plover/build/appimage/plover.AppDir/usr/lib/python3.6/subprocess.py", line 403, in run
      File "/home/travis/build/openstenoproject/plover/build/appimage/plover.AppDir/usr/lib/python3.6/subprocess.py", line 707, in __init__
      File "/home/travis/build/openstenoproject/plover/build/appimage/plover.AppDir/usr/lib/python3.6/subprocess.py", line 1333, in _execute_child
    FileNotFoundError: [Errno 2] No such file or directory: 'pkg-config'

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-ip9pii74/python-rtmidi/

A few other plugins (e.g. plover-midi) also fail with the same error, whereas yet others (e.g. plover-phenrsteno==0.2.3) succeed. @Sillabix

My guess is that some plugins require the presence of the pkg-config directory which instead is missing from the the AppImage directory?

However I may be missing something because I downloaded a fresh copy of the AppImage binary, thinking to be able to start experimenting from scratch. Instead when I launched it, it picked the updated plugin manager (per workaround of issue #1091) and other installed plugins from the previous binary. I tried to figure out where those get installed, but with no success, e.g. there is not ~/.plover or ~/.cache/plover or ~/.config directory. By the way, shouldn't AppImages be self-contained binaries?

Plover Version

4.0.0.dev8+66.g685bd33 (AppImage)

System

Distributor ID: Ubuntu Description: Ubuntu 18.04.4 LTS Release: 18.04 Codename: bionic

benoit-pierre commented 4 years ago

You're missing the necessary development packages for building and installing one of the plugin dependencies. I'm not sure which ones (not a Ubuntu user). I'd try again after installing librtmidi-dev.

davidedelvento commented 4 years ago

Ok, thanks for the hint. The misleading thing is that AppImage is advertised as a self-contained thing, but instead it isn't (or if it is per se, then it's the plover AppImage which is missing parts).

The packages that I was missing are pkg-config, libasound2-dev and either libjack-dev or libjack-jackd2-dev (and gcc if someone is reading this and does not have it installed, but I did). This is very unfortunate, because of the way pip caches things. I deleted the pip cache, but switching between the last two libjack options does not work (I see from the logs that compilation does not rehappen).

At the moment the plugin is installed but nothing happens when I use the MIDI keyboard for input.

benoit-pierre commented 4 years ago

Including every dependency of every plugin in the AppImage is obviously impossible... And some things you can't really include anyway (like gcc).

As for your MIDI keyboard not working, you'll have to provide more information. Did you configure Plover to use the MIDI machine? Are you using the right device? What about the mappings? There's a whole range of possible keys, so you might need to tweak the layout. You can try the included test code by running ./plover-4.0.0.dev8.66.g685bd33-x86_64.AppImage -s plover_midi_test YOUR_DEVICE_NAME in a terminal: this will show the list of detected devices and a trace on each stroke.

davidedelvento commented 4 years ago

That helped. After messing up with it and with other OS settings eventually it is now working.

Thanks a lot for your help and patience!

As far as I am concerned this ticket can be closed, but I am not closing it myself in case you would like to add something to AppImage for the future. Yes, I do understand that you cannot include everything, yet some things seem more important than others and if they are not too large in size.... Perhaps I'm biased, but midi dependencies would be one of them ;-)

Anyway, I won't blame you if you decide not to include them.

davidedelvento commented 4 years ago

One other small thing: the plover-midi plugin could specify its dependencies, per my comment to the plover-midi4text linked above this comment (I'd write this suggestion in https://github.com/benoit-pierre/plover_midi but that repo does not allow issues).

Thanks again!

benoit-pierre commented 4 years ago

One other small thing: the plover-midi plugin could specify its dependencies, per my comment to the plover-midi4text linked above this comment

It does, but only Python dependencies: there's no mechanism to specify system dependencies in Python (or dependencies on distribution packages).

(I'd write this suggestion in https://github.com/benoit-pierre/plover_midi but that repo does not allow issues).

What do you mean? You're not able to create a new issue?

davidedelvento commented 4 years ago

It does, but only Python dependencies: there's no mechanism to specify system dependencies in Python (or dependencies on distribution packages).

Yes I know that, I explained myself incorrectly, sorry. I meant specify in the README for people to read and have some hints on what may be wrong if installation fails. Not in the requirements.txt for the machine to parse and act automatically

What do you mean? You're not able to create a new issue?

Operator error. It seemed that that repo had not enabled issues in its settings, but instead it was me clicking on the wrong link. If you'd like to keep things more neat, let me know and I will delete my last comments to this issue and create a new one there as I did with midi4text.

Thanks again for your patience with all m fat-fingering, and for providing such a nice project!