Subliminal 在 Ubuntu 18.04 中不起作用

Subliminal 在 Ubuntu 18.04 中不起作用

Subliminal 在 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

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

答案1

答案不仅适用于 Ubuntu 18.04、Bionic,也适用于任何安装pip

该问题似乎是由于最新的 Pythonstevedore包与不兼容造成的guessit,正如Debian 错误报告日志

解决方案是stevedorePyPi 存储库,为了做到这一点

  • 使用以下命令卸载从 apt 获取的现有软件包sudo apt-get purge -y python3-stevedore
  • 使用以下方法安装 PyPi 版本的 subliminal 和适当版本的 stevedore:sudo pip3 install subliminal stevedore==1.19.1

现在subliminal从终端运行将使其照常运行:

潜意识 18.04

答案2

argparse现在是 Python2 和 Python3 的一部分,但subliminal依赖于,并且此包包含中的python3-stevedore条目。您可以使用以下命令检查:argparserequires.txt

  • 生动

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

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

解决方案是一个肮脏的黑客,删除以下行:

  • 生动

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

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

对于 Bionic (18.04),上述方法有效,但要考虑到 stevedore 版本较高。可以使用以下命令进行检查:

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

然后搜索 stevedore-* 文件夹。就我而言:

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

答案3

只需这样做:

pip3 install --user subliminal stevedore==1.19.1 

通过 apt 安装 subliminal 后,为了修复 stevedore 版本。这将覆盖系统版本。

相关内容