Debian 升级后某些 Python 程序无法运行

Debian 升级后某些 Python 程序无法运行

apt-get dist-upgrade昨天做了,现在当我尝试运行时出现以下错误anki

Traceback (most recent call last):
  File "/usr/bin/anki", line 5, in <module>
    import aqt
  File "/usr/share/anki/aqt/__init__.py", line 12, in <module>
    from aqt.qt import *
  File "/usr/share/anki/aqt/qt.py", line 22, in <module>
    from PyQt4.QtWebKit import QWebPage, QWebView, QWebSettings
ImportError: No module named QtWebKit

当我尝试运行时calibre

Traceback (most recent call last):
  File "/usr/bin/calibre", line 19, in <module>
    from calibre.gui_launch import calibre
  File "/usr/lib/calibre/calibre/__init__.py", line 22, in <module>
    from calibre.startup import winutil, winutilerror
  File "/usr/lib/calibre/calibre/startup.py", line 149, in <module>
    from calibre.utils.icu import title_case, lower as icu_lower, upper as icu_upper
  File "/usr/lib/calibre/calibre/utils/icu.py", line 28, in <module>
    raise RuntimeError('Failed to load icu with error: %s' % err)
RuntimeError: Failed to load icu with error: No module named icu
/usr/lib/calibre/calibre/ptempfile.py:27: RuntimeWarning: Parent module 'calibre' not found while handling absolute import
  import shutil

任何帮助将非常感激。

答案1

我可以通过安装 Jessie 的 python-qt4 来解决我机器上 Anki 的问题。

  1. https://packages.debian.org/jessie/python-qt4
  2. 下载适合您架构的软件包(在页面底部)
  3. 通过安装它

    sudo dpkg -i python-qt4_4.11.2+dfsg-1_<ARCHITECTURE>.deb
    
  4. 阻止此包的更新

    echo python-qt4 hold | sudo /usr/bin/dpkg --set-selections
    

相关内容