Ubuntu 18.04 上安装 HPLIP 找不到 python 依赖项

Ubuntu 18.04 上安装 HPLIP 找不到 python 依赖项

因此,我一直在努力设置我的 HP 扫描仪/打印机。

尝试获取 hplip(以及 hplip-gui、hplip-setup 等)sudo apt-get install被证明是无用的,因为它显示它已经安装,但是当我尝试访问它时,它声称它尚未安装但可以通过进行安装sudo apt-get install

然后,我尝试通过他们网站上的安装程序(一个名为 hplip-3.20.11-run 的 shell 脚本)进行手动安装,因为这似乎是最受欢迎的方式。这个脚本给出了以下输出:

MISSING DEPENDENCIES
--------------------
Following dependencies are not installed. HPLIP will not work if all REQUIRED dependencies are not installed and some of the HPLIP features will not work if OPTIONAL dependencies are not installed.
Package-Name         Component            Required/Optional   
python3-notify2      gui_qt4              OPTIONAL            
python3-pyqt4-dbus   gui_qt4              OPTIONAL            
python3-pyqt4        gui_qt4              REQUIRED            
python3-dbus         fax                  REQUIRED            
python3-reportlab    fax                  OPTIONAL   

 

当我让安装程序尝试安装这些软件包时,我得到:

RE-CHECKING DEPENDENCIES
------------------------
error: A required dependency 'python3-pyqt4 (PyQt 4- Qt interface for Python (for Qt version 4.x))' is still missing.
error: A required dependency 'python3-dbus (Python DBus - Python bindings for DBus)' is still missing.
error: Installation cannot continue without these dependencies.
error: Please manually install this dependency and re-run this installer.

现在,当我尝试通过 apt-get 执行此操作时,它告诉我这些已经安装:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
python3-pyqt4 is already the newest version (4.12.1+dfsg-2).

对于python3-dbus也一样:

python3-dbus is already the newest version (1.2.6-1).

which python3-pyqt4但是我使用或也找不到它们which python3-dbus......

我认为查找这些包存在一些问题,但我不知道如何解决?

编辑:当我apt-cache policy libcups2-dev cups-bsd cups-client avahi-utils gtk2-engines-pixbuf xsane python3-pyqt4 python3-dbus.mainloop.qt python3-notify2按照下面的建议输入时,我得到:

libcups2-dev:
  Installed: 2.2.7-1ubuntu2.8
  Candidate: 2.2.7-1ubuntu2.8
  Version table:
 *** 2.2.7-1ubuntu2.8 500
        500 http://de.archive.ubuntu.com/ubuntu bionic-updates/main amd64 Packages
        500 http://security.ubuntu.com/ubuntu bionic-security/main amd64 Packages
        100 /var/lib/dpkg/status
     2.2.7-1ubuntu2 500
        500 http://de.archive.ubuntu.com/ubuntu bionic/main amd64 Packages
cups-bsd:
  Installed: 2.2.7-1ubuntu2.8
  Candidate: 2.2.7-1ubuntu2.8
  Version table:
 *** 2.2.7-1ubuntu2.8 500
        500 http://de.archive.ubuntu.com/ubuntu bionic-updates/main amd64 Packages
        500 http://security.ubuntu.com/ubuntu bionic-security/main amd64 Packages
        100 /var/lib/dpkg/status
     2.2.7-1ubuntu2 500
        500 http://de.archive.ubuntu.com/ubuntu bionic/main amd64 Packages
cups-client:
  Installed: 2.2.7-1ubuntu2.8
  Candidate: 2.2.7-1ubuntu2.8
  Version table:
 *** 2.2.7-1ubuntu2.8 500
        500 http://de.archive.ubuntu.com/ubuntu bionic-updates/main amd64 Packages
        500 http://security.ubuntu.com/ubuntu bionic-security/main amd64 Packages
        100 /var/lib/dpkg/status
     2.2.7-1ubuntu2 500
        500 http://de.archive.ubuntu.com/ubuntu bionic/main amd64 Packages
avahi-utils:
  Installed: 0.7-3.1ubuntu1.2
  Candidate: 0.7-3.1ubuntu1.2
  Version table:
 *** 0.7-3.1ubuntu1.2 500
        500 http://de.archive.ubuntu.com/ubuntu bionic-updates/main amd64 Packages
        500 http://security.ubuntu.com/ubuntu bionic-security/main amd64 Packages
        100 /var/lib/dpkg/status
     0.7-3.1ubuntu1 500
        500 http://de.archive.ubuntu.com/ubuntu bionic/main amd64 Packages
gtk2-engines-pixbuf:
  Installed: 2.24.32-1ubuntu1
  Candidate: 2.24.32-1ubuntu1
  Version table:
 *** 2.24.32-1ubuntu1 500
        500 http://de.archive.ubuntu.com/ubuntu bionic/main amd64 Packages
        100 /var/lib/dpkg/status
xsane:
  Installed: 0.999-5ubuntu2
  Candidate: 0.999-5ubuntu2
  Version table:
 *** 0.999-5ubuntu2 500
        500 http://de.archive.ubuntu.com/ubuntu bionic/universe amd64 Packages
        100 /var/lib/dpkg/status
python3-pyqt4:
  Installed: 4.12.1+dfsg-2
  Candidate: 4.12.1+dfsg-2
  Version table:
 *** 4.12.1+dfsg-2 500
        500 http://de.archive.ubuntu.com/ubuntu bionic/universe amd64 Packages
        100 /var/lib/dpkg/status
python3-dbus.mainloop.qt:
  Installed: 4.12.1+dfsg-2
  Candidate: 4.12.1+dfsg-2
  Version table:
 *** 4.12.1+dfsg-2 500
        500 http://de.archive.ubuntu.com/ubuntu bionic/universe amd64 Packages
        100 /var/lib/dpkg/status
python3-notify2:
  Installed: 0.3-3
  Candidate: 0.3-3
  Version table:
 *** 0.3-3 500
        500 http://de.archive.ubuntu.com/ubuntu bionic/universe amd64 Packages
        500 http://de.archive.ubuntu.com/ubuntu bionic/universe i386 Packages
        100 /var/lib/dpkg/status

再准确地说:问题在于安装程序由于这些依赖关系而失败(安装它们本身也会失败),即使它们应该存在。

EDIT2:输出which python

/home/myusername/anaconda3/bin/python

输出which python2

/usr/bin/python2

输出which python3

/home/myusername/anaconda3/bin/python3

输出为dpkg -l | grep python-is:无

答案1

好的,那么你的打印机型号需要HPLIP >=3.18.4,而 Ubuntu 18.04 LTS 有 3.17.10。因此,您必须使用 HPLIP 站点上的二进制版本,遵循链接答案

sudo apt-get update
sudo apt-get upgrade

然后你需要安装 HPLIP 来覆盖 Anaconda 的 python

export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"

cd ~/Downloads
wget https://download.sourceforge.net/project/hplip/hplip/3.20.11/hplip-3.20.11.run
sh hplip-3.20.11.run

按照向导。

对于扫描仪 - 运行hp-plugin安装二进制插件。

还要注意,使用which python3-pyqt4which python3-dbus是不对的。它们是包,因此正确的检查方法是使用apt-cache policy python3-dbus python3-pyqt4

相关内容