2

So I have been struggling to set up my HP scanner/printer for a while now.

Trying to get hplip (as well as hplip-gui, hplip-setup, ...) through sudo apt-get install proved to be useless, cause it shows me that it's already installed, but when I try to access it, it claims it's not installed but could be installed through sudo apt-get install.

I then tried the manual installation through the installer on their website (a shell script called hplip-3.20.11-run), since this seems to be the favoured way of doing it. This one gives me the following output:

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

when I let the installer try to install these packages, I get:

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.

now when I try to do it via apt-get, it tells me these are already installed:

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

same for python3-dbus:

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

However I also can't find them using which python3-pyqt4 or which python3-dbus...

I assume there's some problem with finding these packages, but I don't know how to fix it?

EDIT: When I type apt-cache policy libcups2-dev cups-bsd cups-client avahi-utils gtk2-engines-pixbuf xsane python3-pyqt4 python3-dbus.mainloop.qt python3-notify2 as suggested below, I get:

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

to be precise again: The problem is that the installer fails due to these dependencies (also fails at installing them itself), even though they should be present.

EDIT2: output for which python:

/home/myusername/anaconda3/bin/python

output for which python2:

/usr/bin/python2

output for which python3:

/home/myusername/anaconda3/bin/python3

output for dpkg -l | grep python-is: nothing

1 Answers1

1

Ok, so your printer model requires HPLIP >=3.18.4, while Ubuntu 18.04 LTS has 3.17.10. So you have to use binary version from HPLIP site, following the linked answer:

sudo apt-get update
sudo apt-get upgrade

Then you need to install HPLIP overriding Anaconda's 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

following the wizard.

For the scanner - run hp-plugin to install binary plugin.

Also note that using which python3-pyqt4 and which python3-dbus is not correct. They are packages, so the correct way to check is to use apt-cache policy python3-dbus python3-pyqt4.

N0rbert
  • 99,918
  • as I outlined, this very same wizard fails during installation process, having the wrong installer is not the problem, it just can't find these packages. – DeliciousDishes Jan 03 '21 at 20:25
  • I have the same problem and your solution did help me install the latest Hplip overriding the Anaconda's python(that was the problem for me in installation). But hp-setup is failing with a segmentation fault when I am trying to install the USB printer. I have Ubuntu 22.04, Running on AMD 64 bit CPU. CUPS is working fine. The printer I am trying to install is LaseJet 1213nf – pennywise666 May 02 '23 at 06:58