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

  • Start with `sudo apt-get install hplip-gui`. What is your HP device model? – N0rbert Jan 03 '21 at 18:21
  • 3
    Does this answer your question? [How to install HPLIP on my Ubuntu to support my HP printer and/or scanner?](https://askubuntu.com/questions/1137815/how-to-install-hplip-on-my-ubuntu-to-support-my-hp-printer-and-or-scanner) – N0rbert Jan 03 '21 at 18:22
  • my printer is a HP LaserJet Pro MFP 28a, I guess this means I have to have the manual installation anyways to make it work. The problem is however not the version required by the printer, but that I literally cannot get ANY version *installed*! Neither the installer provided by HP, NOR through `apt-get install` work, both have trouble finding packages it seems. – DeliciousDishes Jan 03 '21 at 18:58
  • Please add output of `apt-cache policy libcups2-dev cups-bsd cups-client avahi-utils gtk2-engines-pixbuf xsane python3-pyqt4 python3-dbus.mainloop.qt python3-notify2` to the question (or share them on pastebin). – N0rbert Jan 03 '21 at 19:37
  • I added it to the question. – DeliciousDishes Jan 03 '21 at 20:24
  • Output of *apt-cache policy…* looks correct. Which version of hplip binary installer do you use currently? I have just checked 3.20.11 on fresh 18.04 LTS VM - it installs normally. – N0rbert Jan 03 '21 at 20:34
  • I'm using 3.20.11 as well – DeliciousDishes Jan 03 '21 at 20:54
  • It maybe python issue. Please add output of `which python`, `which python2`, `which python`, `dpkg -l | grep python-is`. – N0rbert Jan 04 '21 at 07:05
  • I have added those to the question in EDIT2 – DeliciousDishes Jan 05 '21 at 08:54
  • You have to temporarily remove anaconda from path and then retry hplip installation. – N0rbert Jan 05 '21 at 11:46
  • I'm embarassed I didn't think of that, that kind of did it! There's still some problems with the scanner plugins, but at least I can print now. Thanks a lot! – DeliciousDishes Jan 05 '21 at 17:10

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
  • 97,162
  • 34
  • 239
  • 423
  • 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