How to install python3-pyqt4 on Linux Mint 20? HPLIP dependency

5,558

An alternative solution. Set up the printer as a driverless printer.

With some help on the Linux Mint forum I was able to get the printer working without the use of HPLIP. This is through, as I learned, the printers ability to support driverless printing. As it may help someone in the future this is the procedure to follow.

  1. Make sure the printer and computer are on the same wireless network

  2. Use the avavi-browse commands to search for devices on the local wireless network. Use the CUPS driverless and lpstat commands to list relevant printer status

avahi-browse -rt _ipp._tcp
avahi-browse -rt _uscan._tcp
driverless
lpstat -l -e

Example avahi-browse -rt _ipp._tcp output:

➜  ~ avahi-browse -rt _ipp._tcp
+ wlp1s0 IPv6 HP ENVY 6000 series [B68C8C]                  Internet Printer     local
+ wlp1s0 IPv4 HP ENVY 6000 series [B68C8C]                  Internet Printer     local
= wlp1s0 IPv4 HP ENVY 6000 series [B68C8C]                  Internet Printer     local
   hostname = [HP3822E2B68C8C.local]
   address = [192.168.1.190]
   port = [631]
   txt = ["Fax=F" "mopria-certified=2.0" "Scan=T" "kind=document,envelope,photo,postcard" "URF=CP1,MT1-2-8-9-10-11,PQ3-4-5,RS300-600,SRGB24,OB9,OFU0,W8-16,DEVW8-16,DEVRGB24-48,ADOBERGB24-48,DM3,IS1,V1.4,FN3" "PaperMax=legal-A4" "pdl=application/vnd.hp-PCL,image/jpeg,image/urf,image/pwg-raster,application/PCLm" "Duplex=T" "Color=T" "usb_MDL=ENVY 6000 series" "usb_MFG=HP" "ty=HP ENVY 6000 series" "product=(HP ENVY 6000 series)" "UUID=9dddcf7d-2ef9-51a5-8be4-be1e5e3ebfc2" "rp=ipp/print" "TLS=1.2" "qtotal=1" "priority=20" "note=" "adminurl=http://HP3822E2B68C8C.local./#hId-pgAirPrint" "txtvers=1"]
= wlp1s0 IPv6 HP ENVY 6000 series [B68C8C]                  Internet Printer     local
   hostname = [HP3822E2B68C8C.local]
   address = [192.168.1.190]
   port = [631]
   txt = ["Fax=F" "mopria-certified=2.0" "Scan=T" "kind=document,envelope,photo,postcard" "URF=CP1,MT1-2-8-9-10-11,PQ3-4-5,RS300-600,SRGB24,OB9,OFU0,W8-16,DEVW8-16,DEVRGB24-48,ADOBERGB24-48,DM3,IS1,V1.4,FN3" "PaperMax=legal-A4" "pdl=application/vnd.hp-PCL,image/jpeg,image/urf,image/pwg-raster,application/PCLm" "Duplex=T" "Color=T" "usb_MDL=ENVY 6000 series" "usb_MFG=HP" "ty=HP ENVY 6000 series" "product=(HP ENVY 6000 series)" "UUID=9dddcf7d-2ef9-51a5-8be4-be1e5e3ebfc2" "rp=ipp/print" "TLS=1.2" "qtotal=1" "priority=20" "note=" "adminurl=http://HP3822E2B68C8C.local./#hId-pgAirPrint" "txtvers=1"]

Example avahi-browse -rt _uscan._tcp output:

➜  ~ avahi-browse -rt _uscan._tcp
+ wlp1s0 IPv4 HP ENVY 6000 series [B68C8C]                  _uscan._tcp          local
+ wlp1s0 IPv6 HP ENVY 6000 series [B68C8C]                  _uscan._tcp          local
= wlp1s0 IPv4 HP ENVY 6000 series [B68C8C]                  _uscan._tcp          local
   hostname = [HP3822E2B68C8C.local]
   address = [192.168.1.190]
   port = [8080]
   txt = ["mopria-certified-scan=1.2" "duplex=F" "is=platen" "cs=binary,color,grayscale" "pdl=application/octet-stream,application/pdf,image/jpeg" "ty=HP ENVY 6000 series" "rs=eSCL" "representation=images/printer.png" "vers=2.63" "UUID=9dddcf7d-2ef9-51a5-8be4-be1e5e3ebfc2" "note=" "adminurl=http://HP3822E2B68C8C.local." "txtvers=1"]
= wlp1s0 IPv6 HP ENVY 6000 series [B68C8C]                  _uscan._tcp          local
   hostname = [HP3822E2B68C8C.local]
   address = [192.168.1.190]
   port = [8080]
   txt = ["mopria-certified-scan=1.2" "duplex=F" "is=platen" "cs=binary,color,grayscale" "pdl=application/octet-stream,application/pdf,image/jpeg" "ty=HP ENVY 6000 series" "rs=eSCL" "representation=images/printer.png" "vers=2.63" "UUID=9dddcf7d-2ef9-51a5-8be4-be1e5e3ebfc2" "note=" "adminurl=http://HP3822E2B68C8C.local." "txtvers=1"]

Example driverless output:

➜  ~ driverless
ipp://HP%20ENVY%206000%20series%20%5BB68C8C%5D._ipp._tcp.local/

Example lpstat -l -e output:

➜  ~ lpstat -l -e 
HP_ENVY_6000_series_B68C8C_ permanent ipp://localhost/printers/HP_ENVY_6000_series_B68C8C_ implicitclass://HP_ENVY_6000_series_B68C8C_/
  1. Using the information from the previous commands setup the driverless printer.

The command to run is:

lpadmin -p [PRINTER-NAME] -v [URI] -E -m everywhere

PRINTER-NAME is merely replaced with the name you wish to give.

The URI is replaced with the URI of the printer. There are two methods for this. You can use the output of the driverless command. This initially worked for me until I restarted the computer and then it stopped working. The other option is to use the IP listed from the avahi-browse command in the format ipp://[IP]/ipp/print to point to the exact location of the printer. This IP can be double checked by logging into your router. Example of full command:

➜  ~ lpadmin -p envy6000 -v ipp://192.168.1.190:631/ipp/print -E -m everywhere
  1. Print a test page to make sure it works

➜ ~ lp -d envy6000 /etc/nsswitch.conf

That should be it. It should now print through all programs and be found in the Printers dialogue box.

Share:
5,558
joe92
Author by

joe92

echo 'Hello world!';

Updated on September 18, 2022

Comments

  • joe92
    joe92 almost 2 years

    In order to install HPLIP 3.20.6 I need to install the dependency python3-pyqt4.

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

    When trying to install through apt I get the error that it cannot be found.

    E: Unable to locate package python3-pyqt4

    How can I install this dependency?

    I need to install HPLIP 3.20.5 or greater in order to be able to use a new printer so any help in resolving this is much appreciated. Thank you.

    Edit: To further clarify. The printer I am trying to connect to is HP Envy 6020. On the HPLIP list of supported devices the Envy 6000 series is supported but it requires a minimum of 3.20.5 HPLIP to run. Ergo, I need to install that version and it is requiring python3-pyqt4 in order to install.

    • ajgringo619
      ajgringo619 almost 4 years
      Is there a reason that the version that comes with Mint 20 (3.20.3+dfsg0-2) doesn't work for you?
    • ajgringo619
      ajgringo619 almost 4 years
      Your best option is to install the QT4 PPA, as outlined here: ubuntuhandbook.org/index.php/2020/07/install-qt4-ubuntu-20-0‌​4
    • joe92
      joe92 almost 4 years
      Thank you for the suggestion ajgringo. Unfortunately the qt4 PPA doesn't include the python3-pyqt4 package.
  • joe92
    joe92 almost 4 years
    Ah. Ok, installing python3-pyqt5 worked easy as pie. However, the installation for HPLIP is still demanding pyqt4. Is there a method to install that older version?
  • GracefulRestart
    GracefulRestart almost 4 years
    If you absolutely need Qt4, it would probably be better to use Linux Mint 19 where Qt4 should be available.
  • Garo
    Garo almost 4 years
    Using the PPA so that you can use Qt4 on Mint 20 will work ( see comment of @ajgringo619 in your question). But HPLIP 3.20.3 works with Qt5 so 3.20.5 certainly also works. I expect that you are installing it incorrectly. Please add the procedure you are using in your question.
  • joe92
    joe92 almost 4 years
    HPLIP 3.20.3 works out the box and is the one that comes with Mint 20. However, for the printer I am trying to connect to it requires a min of 3.20.5, hence my question on upgrades. Thank you, I will check out the comment on the Q