Subliminal does not work in Ubuntu 18.04

Subliminal gives this error in Ubuntu 18.04

Traceback (most recent call last):
  File "/usr/bin/subliminal", line 9, in <module>
    load_entry_point('subliminal==1.1.1', 'console_scripts', 'subliminal')()
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 480, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2693, in load_entry_point
    return ep.load()
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2324, in load
    return self.resolve()
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2330, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/usr/lib/python3/dist-packages/subliminal/__init__.py", line 10, in <module>
    from .api import (ProviderPool, check_video, provider_manager, download_best_subtitles, download_subtitles,
  File "/usr/lib/python3/dist-packages/subliminal/api.py", line 13, in <module>
    from .subtitle import compute_score, get_subtitle_path
  File "/usr/lib/python3/dist-packages/subliminal/subtitle.py", line 7, in <module>
    from guessit.matchtree import MatchTree
  File "/usr/lib/python3/dist-packages/guessit/__init__.py", line 99, in <module>
    from guessit.plugins import transformers
  File "/usr/lib/python3/dist-packages/guessit/plugins/transformers.py", line 222, in <module>
    reload()
  File "/usr/lib/python3/dist-packages/guessit/plugins/transformers.py", line 220, in reload
    reload_options(all_transformers())
  File "/usr/lib/python3/dist-packages/guessit/plugins/transformers.py", line 179, in all_transformers
    return _extensions.objects()
  File "/usr/lib/python3/dist-packages/guessit/plugins/transformers.py", line 111, in objects
    return self.map(self._get_obj)
  File "/usr/lib/python3/dist-packages/stevedore/extension.py", line 261, in map
    raise NoMatches('No %s extensions found' % self.namespace)
stevedore.exception.NoMatches: No guessit.transformer extensions found

Output of apt-cache policy subliminal

  Installed: 1.1.1-2
  Candidate: 1.1.1-2
  Version table:
 *** 1.1.1-2 500
        500 http://in.archive.ubuntu.com/ubuntu bionic/universe amd64 Packages
        500 http://in.archive.ubuntu.com/ubuntu bionic/universe i386 Packages
        100 /var/lib/dpkg/status

Answer that works not only for Ubuntu 18.04, Bionic but also any release with pip installed

The problem appears to be an incompatibility between the latest python stevedore package and guessit, as reported in the Debian Bug Report Logs

The solution would be to install an appropriate version of stevedore from the PyPi Repository, in order to do that

  • Uninstall the existing packages that you've obtained from apt by using sudo apt-get purge -y python3-stevedore
  • Install the PyPi version of subliminal with the appropriate version of stevedore by using sudo pip3 install subliminal stevedore==1.19.1

Now running subliminal from the terminal will let it run as usual:

Subliminal on 18.04


argparse is now part of Python2 and Python3, but subliminal depends on python3-stevedore and this package contains the entry argparse in requires.txt. You can check this with:

  • Vivid

    cat /usr/lib/python3/dist-packages/stevedore-1.3.0.egg-info/requires.txt
    
  • Wily

    cat /usr/lib/python3/dist-packages/stevedore-1.5.0.egg-info/requires.txt
    

The solution is a dirty hack, remove the line:

  • Vivid

    sudo sed -i.bak '/argparse/d' /usr/lib/python3/dist-packages/stevedore-1.3.0.egg-info/requires.txt
    
  • Wily

    sudo sed -i.bak '/argparse/d' /usr/lib/python3/dist-packages/stevedore-1.5.0.egg-info/requires.txt
    

For Bionic (18.04) the above works but take into account the stevedore version is higher. It can be checked with:

ls -l /usr/lib/python3/dist-packages/

and then search for the stevedore-* folder. In my case:

sudo sed -i.bak '/argparse/d' /usr/lib/python3/dist-packages/stevedore-1.28.0.egg-info/requires.txt