Cannot install hplip plugin on Ubuntu 20.04

Asked by Richard Trinkner

I'm trying to install hplip 3.20.5 on Ubuntu 20.04, but need to install the plugin to print via my network to my HP LaserJet Professional P1606dn printer. I can't get the plugin to install through the GUI, and when I install it manually, the Device Manager still requires me to try to install it.

Hplip 3.20.5 seems to install OK, but I need to install the plugin to print to this printer.

Installing the plugin seems to work:

$ sudo sh hplip-3.20.5-plugin.run
[sudo] password for richard:
Verifying archive integrity... All good.
Uncompressing HPLIP 3.20.5 Plugin Self Extracting Archive..............................................................

HP Linux Imaging and Printing System (ver. 3.20.5)
Plugin Installer ver. 3.0

Copyright (c) 2001-18 HP Development Company, LP
This software comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to distribute it
under certain conditions. See COPYING file for more details.

Plug-in version: 3.20.5
Installed HPLIP version: 3.20.5
Number of files to install: 64

note: Using PyQt5
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root'

Done.

However, whenever I try to use the HP Device Manager, the following error appears in the Linux terminal:

HP Linux Imaging and Printing System (ver. 3.20.5)
HP Device Manager ver. 15.0

Copyright (c) 2001-18 HP Development Company, LP
This software comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to distribute it
under certain conditions. See COPYING file for more details.

/usr/share/hplip/ui5/devmgr_ext.py:15: SyntaxWarning: "is not" with a literal. Did you mean "!="?
  if self.latest_available_version is not "":
/usr/share/hplip/ui5/devmgr_ext.py:37: SyntaxWarning: "is not" with a literal. Did you mean "!="?
  if self.latest_available_version is not "":

When I continue in the GUI to select my Network/Ethernet/Wireless printer, the GUI properly displays my printer's model and IP address. But when I click Next, I'm asked to install the plugin (which I thought I had already installed above...).

If I choose the download option, nothing happens. (My WiFi connection is fine...)
If I choose the select a local copy, I specify my local copy of hplip-3.20.5-plugin.run, and again nothing happens.

Thanks for your help!

Question information

Language:
English Edit question
Status:
Answered
For:
HPLIP Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Richard Trinkner (trinkner) said :
#1

I'm posting the output of hp-check, if it is of interest. The printer that is listed is one that my system auto-discovers, not the version it that I'm trying to install with hplip. The autodiscovered one doesn't work either.

 hp-check
/usr/bin/hp-check:685: SyntaxWarning: "is not" with a literal. Did you mean "!="?
  if 'getfacl' not in g and '' is not g and 'file' not in g:
Saving output in log file: /home/richard/Dropbox/Downloads/Linux/Drivers/hp-check.log

HP Linux Imaging and Printing System (ver. 3.20.5)
Dependency/Version Check Utility ver. 15.1

Copyright (c) 2001-18 HP Development Company, LP
This software comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to distribute it
under certain conditions. See COPYING file for more details.

Note: hp-check can be run in three modes:
1. Compile-time check mode (-c or --compile): Use this mode before compiling the HPLIP supplied tarball (.tar.gz or .run) to determine if the proper dependencies are installed to successfully compile HPLIP.
2. Run-time check mode (-r or --run): Use this mode to determine if a distro supplied package (.deb, .rpm, etc) or an already built HPLIP supplied tarball has the proper dependencies installed to successfully
run.
3. Both compile- and run-time check mode (-b or --both) (Default): This mode will check both of the above cases (both compile- and run-time dependencies).

Check types:
a. EXTERNALDEP - External Dependencies
b. GENERALDEP - General Dependencies (required both at compile and run time)
c. COMPILEDEP - Compile time Dependencies
d. [All are run-time checks]
PYEXT SCANCONF QUEUES PERMISSION

Status Types:
    OK
    MISSING - Missing Dependency or Permission or Plug-in
    INCOMPAT - Incompatible dependency-version or Plugin-version

---------------
| SYSTEM INFO |
---------------

 Kernel: 5.4.0-33-generic #37-Ubuntu SMP Thu May 21 12:53:59 UTC 2020 GNU/Linux
 Host: richard-Precision-5540
 Proc: 5.4.0-33-generic #37-Ubuntu SMP Thu May 21 12:53:59 UTC 2020 GNU/Linux
 Distribution: 12 20.04
 Bitness: 64 bit

-----------------------
| HPLIP CONFIGURATION |
-----------------------

HPLIP-Version: HPLIP 3.20.5
HPLIP-Home: /usr/share/hplip
HPLIP-Installation: Auto installation is supported for ubuntu distro 20.04 version

Current contents of '/etc/hp/hplip.conf' file:
# hplip.conf. Generated from hplip.conf.in by configure.

[hplip]
version=3.20.5

[dirs]
home=/usr/share/hplip
run=/var/run
ppd=/usr/share/ppd/HP
ppdbase=/usr/share/ppd
doc=/usr/share/doc/hplip-3.20.5
html=/usr/share/doc/hplip-3.20.5
icon=/usr/share/applications
cupsbackend=/usr/lib/cups/backend
cupsfilter=/usr/lib/cups/filter
drv=/usr/share/cups/drv/hp
bin=/usr/bin
apparmor=/etc/apparmor.d
# Following values are determined at configure time and cannot be changed.
[configure]
network-build=yes
libusb01-build=no
pp-build=no
gui-build=yes
scanner-build=yes
fax-build=yes
dbus-build=yes
cups11-build=no
doc-build=yes
shadow-build=no
hpijs-install=no
foomatic-drv-install=no
foomatic-ppd-install=no
foomatic-rip-hplip-install=no
hpcups-install=yes
cups-drv-install=yes
cups-ppd-install=no
internal-tag=3.20.5
restricted-build=no
ui-toolkit=qt5
qt3=no
qt4=no
qt5=yes
policy-kit=no
lite-build=no
udev_sysfs_rules=no
hpcups-only-build=no
hpijs-only-build=no
apparmor_build=yes
class-driver=no

Current contents of '/var/lib/hp/hplip.state' file:
[plugin]
installed = 1
eula = 1
version = 3.20.5

Current contents of '~/.hplip/hplip.conf' file:
[upgrade]
notify_upgrade = true
last_upgraded_time = 1591234875
pending_upgrade_time = 0

[last_used]
device_uri = hp:/net/HP_LaserJet_Professional_P1606dn?ip=192.168.1.136
printer_name = BasementHP

[installation]
date_time = 06/03/20 20:11:52
version = 3.20.5

 <Package-name> <Package-Desc> <Required/Optional> <Min-Version> <Installed-Version> <Status> <Comment>

-------------------------
| External Dependencies |
-------------------------

 cups CUPS - Common Unix Printing System REQUIRED 1.1 2.3.1 OK 'CUPS Scheduler is running'
 gs GhostScript - PostScript and PDF language interpreter and previewer REQUIRED 7.05 9.50 OK -
 xsane xsane - Graphical scanner frontend for SANE OPTIONAL 0.9 0.999 OK -
 scanimage scanimage - Shell scanning program OPTIONAL 1.0 1.0.29 OK -
 dbus DBus - Message bus system REQUIRED - 1.12.16 OK -
 policykit PolicyKit - Administrative policy framework OPTIONAL - 0.105 OK -
 network network -wget OPTIONAL - 1.20.3 OK -
 avahi-utils avahi-utils OPTIONAL - 0.7 OK -

------------------------
| General Dependencies |
------------------------

 libjpeg libjpeg - JPEG library REQUIRED - - OK -
 cups-devel CUPS devel- Common Unix Printing System development files REQUIRED - 2.3.1 OK -
 cups-image CUPS image - CUPS image development files REQUIRED - 2.3.1 OK -
 libpthread libpthread - POSIX threads library REQUIRED - b'2.31' OK -
 libusb libusb - USB library REQUIRED - 1.0 OK -
 sane SANE - Scanning library REQUIRED - - OK -
 sane-devel SANE - Scanning library development files REQUIRED - - OK -
 libnetsnmp-devel libnetsnmp-devel - SNMP networking library development files REQUIRED 5.0.9 5.8 OK -
 libcrypto libcrypto - OpenSSL cryptographic library REQUIRED - 1.1.1 OK -
 python3X Python 2.2 or greater - Python programming language REQUIRED 2.2 3.8.2 OK -
 python3-notify2 Python libnotify - Python bindings for the libnotify Desktop notifications OPTIONAL - - OK -
 python3-pyqt5-dbus PyQt 5 DBus - DBus Support for PyQt5 OPTIONAL 5.0 5.14.1 OK -
 python3-pyqt5 PyQt 5- Qt interface for Python (for Qt version 4.x) REQUIRED 5.0 5.14.1 OK -
 python3-dbus Python DBus - Python bindings for DBus REQUIRED 0.80.0 1.2.16 OK -
 python3-xml Python XML libraries REQUIRED - 2.2.9 OK -
 python3-devel Python devel - Python development files REQUIRED 2.2 3.8.2 OK -
 python3-pil PIL - Python Imaging Library (required for commandline scanning with hp-scan) OPTIONAL - 7.0.0 OK -
 python3-reportlab Reportlab - PDF library for Python OPTIONAL 2.0 3.5.34 OK -

--------------
| COMPILEDEP |
--------------

 libtool libtool - Library building support services REQUIRED - 2.4.6 OK -
 gcc gcc - GNU Project C and C++ Compiler REQUIRED - 9.3.0 OK -
 make make - GNU make utility to maintain groups of programs REQUIRED 3.0 4.2.1 OK -

---------------------
| Python Extentions |
---------------------

 cupsext CUPS-Extension REQUIRED - 3.20.5 OK -
 hpmudext IO-Extension REQUIRED - 3.20.5 OK -

----------------------
| Scan Configuration |
----------------------

 hpaio HPLIP-SANE-Backend REQUIRED - 3.20.5 OK 'hpaio found in /etc/sane.d/dll.conf'
 scanext Scan-SANE-Extension REQUIRED - 3.20.5 OK -

------------------------------
| DISCOVERED SCANNER DEVICES |
------------------------------

No Scanner found.

--------------------------
| DISCOVERED USB DEVICES |
--------------------------

No devices found.

---------------------------------
| INSTALLED CUPS PRINTER QUEUES |
---------------------------------

HP_LaserJet_Professional_P1606dn
--------------------------------
Type: Unknown
Device URI: implicitclass://HP_LaserJet_Professional_P1606dn/
PPD: /etc/cups/ppd/HP_LaserJet_Professional_P1606dn.ppd
warning: Failed to read /etc/cups/ppd/HP_LaserJet_Professional_P1606dn.ppd ppd file
PPD Description:
Printer status: printer HP_LaserJet_Professional_P1606dn now printing HP_LaserJet_Professional_P1606dn-31. enabled since Wed 03 Jun 2020 08:12:03 PM MDT
warning: Printer is not HPLIP installed. Printers must use the hp: or hpfax: CUPS backend for HP-Devices.

--------------
| PERMISSION |
--------------

-----------
| SUMMARY |
-----------

Missing Required Dependencies
-----------------------------
None

Missing Optional Dependencies
-----------------------------
None

Total Errors: 0
Total Warnings: 1

Done.

Revision history for this message
Richard Trinkner (trinkner) said :
#2

When I try to add the printer through the CLI, I receive the following errors when i try to download the plugin.

sudo hp-setup -a 192.168.1.136
[sudo] password for richard:

HP Linux Imaging and Printing System (ver. 3.20.5)
Printer/Fax Setup Utility ver. 9.0

Copyright (c) 2001-18 HP Development Company, LP
This software comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to distribute it
under certain conditions. See COPYING file for more details.

QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root'
Searching for device...
Found device: hp:/net/HP_LaserJet_Professional_P1606dn?ip=192.168.1.136

HP Linux Imaging and Printing System (ver. 3.20.5)
Plugin Download and Install Utility ver. 2.1

Copyright (c) 2001-18 HP Development Company, LP
This software comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to distribute it
under certain conditions. See COPYING file for more details.

warning: It is not recommended to run 'hp-plugin' in a root mode.

HP Linux Imaging and Printing System (ver. 3.20.5)
Plugin Download and Install Utility ver. 2.1

Copyright (c) 2001-18 HP Development Company, LP
This software comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to distribute it
under certain conditions. See COPYING file for more details.

(Note: Defaults for each question are maked with a '*'. Press <enter> to accept the default.)

-----------------------------------------
| PLUG-IN INSTALLATION FOR HPLIP 3.20.5 |
-----------------------------------------

  Option Description
  ---------- --------------------------------------------------
  d Download plug-in from HP (recommended)
  p Specify a path to the plug-in (advanced)
  q Quit hp-plugin (skip installation)

Enter option (d=download*, p=specify path, q=quit) ? d

-------------------
| DOWNLOAD PLUGIN |
-------------------

Checking for network connection...
Downloading plug-in from:
Downloading plug-in: [\ ] 0% Traceback (most recent call last):
  File "/usr/share/hplip/base/password.py", line 85, in get_distro_name
    os_name = platform.dist()[0]
AttributeError: module 'platform' has no attribute 'dist'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/bin/hp-plugin", line 363, in <module>
    status, plugin_path, error_str = pluginObj.download(plugin_path, plugin_download_callback)
  File "/usr/share/hplip/installer/pluginhandler.py", line 254, in download
    core = core_install.CoreInstall()
  File "/usr/share/hplip/installer/core_install.py", line 240, in __init__
    self.passwordObj = password.Password(ui_mode)
  File "/usr/share/hplip/base/password.py", line 118, in __init__
    self.__readAuthType() # self.__authType
  File "/usr/share/hplip/base/password.py", line 141, in __readAuthType
    distro_name = get_distro_name().lower().replace(" ","")
  File "/usr/share/hplip/base/password.py", line 88, in get_distro_name
    os_name = distro.linux_distribution()[0]
  File "/usr/lib/python3/dist-packages/distro.py", line 122, in linux_distribution
    return _distro.linux_distribution(full_distribution_name)
  File "/usr/lib/python3/dist-packages/distro.py", line 677, in linux_distribution
    self.version(),
  File "/usr/lib/python3/dist-packages/distro.py", line 737, in version
    self.lsb_release_attr('release'),
  File "/usr/lib/python3/dist-packages/distro.py", line 899, in lsb_release_attr
    return self._lsb_release_info.get(attribute, '')
  File "/usr/lib/python3/dist-packages/distro.py", line 552, in __get__
    ret = obj.__dict__[self._fname] = self._f(obj)
  File "/usr/lib/python3/dist-packages/distro.py", line 1012, in _lsb_release_info
    stdout = subprocess.check_output(cmd, stderr=devnull)
  File "/usr/lib/python3.8/subprocess.py", line 411, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
  File "/usr/lib/python3.8/subprocess.py", line 512, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '('lsb_release', '-a')' returned non-zero exit status 1.
Error in sys.excepthook:
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 144, in apport_excepthook
    with os.fdopen(os.open(pr_filename,
PermissionError: [Errno 13] Permission denied: '/var/crash/_usr_share_hplip_plugin.py.0.crash'

Original exception was:
Traceback (most recent call last):
  File "/usr/share/hplip/base/password.py", line 85, in get_distro_name
    os_name = platform.dist()[0]
AttributeError: module 'platform' has no attribute 'dist'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/bin/hp-plugin", line 363, in <module>
    status, plugin_path, error_str = pluginObj.download(plugin_path, plugin_download_callback)
  File "/usr/share/hplip/installer/pluginhandler.py", line 254, in download
    core = core_install.CoreInstall()
  File "/usr/share/hplip/installer/core_install.py", line 240, in __init__
    self.passwordObj = password.Password(ui_mode)
  File "/usr/share/hplip/base/password.py", line 118, in __init__
    self.__readAuthType() # self.__authType
  File "/usr/share/hplip/base/password.py", line 141, in __readAuthType
    distro_name = get_distro_name().lower().replace(" ","")
  File "/usr/share/hplip/base/password.py", line 88, in get_distro_name
    os_name = distro.linux_distribution()[0]
  File "/usr/lib/python3/dist-packages/distro.py", line 122, in linux_distribution
    return _distro.linux_distribution(full_distribution_name)
  File "/usr/lib/python3/dist-packages/distro.py", line 677, in linux_distribution
    self.version(),
  File "/usr/lib/python3/dist-packages/distro.py", line 737, in version
    self.lsb_release_attr('release'),
  File "/usr/lib/python3/dist-packages/distro.py", line 899, in lsb_release_attr
    return self._lsb_release_info.get(attribute, '')
  File "/usr/lib/python3/dist-packages/distro.py", line 552, in __get__
    ret = obj.__dict__[self._fname] = self._f(obj)
  File "/usr/lib/python3/dist-packages/distro.py", line 1012, in _lsb_release_info
    stdout = subprocess.check_output(cmd, stderr=devnull)
  File "/usr/lib/python3.8/subprocess.py", line 411, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
  File "/usr/lib/python3.8/subprocess.py", line 512, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '('lsb_release', '-a')' returned non-zero exit status 1.

Revision history for this message
ghp (ghpille) said :
#3

Have a look at https://docs.python.org/2/library/platform.html

This script isn't suited for a python 3.8, it seems to me.

Revision history for this message
Manfred Hampl (m-hampl) said :
#4

"subprocess.CalledProcessError: Command '('lsb_release', '-a')' returned non-zero exit status 1."

What is the output of the command

lsb_release -crid

Revision history for this message
Richard Trinkner (trinkner) said :
#5

$ lsb_release -crid
Distributor ID: Ubuntu
Description: Ubuntu 20.04 LTS
Release: 20.04
Codename: focal

(Just shows that I'm using Ubuntu 20.04.0

Revision history for this message
Manfred Hampl (m-hampl) said :
#6

This command works well, and what is the output of

lsb_release -a
echo $?

Revision history for this message
Richard Trinkner (trinkner) said :
#7

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 20.04 LTS
Release: 20.04
Codename: focal

$echo

(displays nothing....)

Revision history for this message
Richard Trinkner (trinkner) said :
#8

I edited line 85 in /usr/share/hplip/base/password.py to read

    try:
        #os_name = platform.dist()[0]
        os_name = 'ubuntu'

Now the plug in installation routine apparently finishes, but when I try to install my printer, hp-setup still tells me that I need to install the plugin. I'm thinking that the edit above prevented the program from halting, but it may have prevented the program from running correctly.

I also tried editing the file to read

    try:
        #os_name = platform.dist()[0]
        os_name = 'debian'

but that created a problem wherein hp-plugin refused to accept my sudo password and thereby aborted.

Revision history for this message
Manfred Hampl (m-hampl) said :
#9

This is weird.

I do not understand why the script fails, because there is a try - except
    try:
        os_name = platform.dist()[0]
    except AttributeError:
that should catch the error and allow continuing.

And for the other exception, please provide the output that you receive when executing the two commands in succession

lsb_release -a
echo $?

(yes: "echo", space, Dollar sign and question mark).

Revision history for this message
Richard Trinkner (trinkner) said :
#10

Thanks for helping, Manfred.

Here's the output:

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 20.04 LTS
Release: 20.04
Codename: focal
richard@richard-Precision-5540:~$ echo $?
0
richard@richard-Precision-5540:~$

Revision history for this message
Richard Trinkner (trinkner) said :
#11

Now I can print, but I don't think I'm using the HP device manager to do so.

After reading the hp-check output, I noticed that the program couldn't access /etc/cups/ppd/HP_LaserJet_Professional_P1606dn.ppd for the printer.

In the terminal, I changed to the ppd directory

cd /etc/cups/ppd

And then changed the permissions for the file

sudo chmod 754 HP_LaserJet_Professional_P1606dn.ppd

Now I can print through that printer.

When I print a Ubuntu test page from the system's Printers dialog, the printed page states:

Make and Model HP HP LaserJet Professional P1606dn, driverless

Does that means that the system is not using the HP driver, but instead using the system's default driver for that printer?

When I start HP Device Manager from the system tray, it states that no installed devices are found.

So, somehow the printer is working now. But I don't have confidence that it will remain working since it's not shown in the HP Device Manager.

Revision history for this message
Manfred Hampl (m-hampl) said :
#12

What do you get for

 hp-setup -a 192.168.1.136

(without sudo)?

Revision history for this message
Richard Trinkner (trinkner) said :
#13

hp-setup -a 192.168.1.136
error: Unable to locate models.dat file

HP Linux Imaging and Printing System (ver. 3.20.5)
Printer/Fax Setup Utility ver. 9.0

Copyright (c) 2001-18 HP Development Company, LP
This software comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to distribute it
under certain conditions. See COPYING file for more details.

Searching for device...
Traceback (most recent call last):
  File "/usr/share/hplip/base/models.py", line 559, in __getitem__
    return self.__cache[model]
KeyError: 'hp_laserjet_professional_p1606dn'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/bin/hp-setup", line 317, in <module>
    dlg = ui.SetupDialog(None, param, jd_port, device_uri, remove)
  File "/usr/share/hplip/ui5/setupdialog.py", line 190, in __init__
    self.initUi()
  File "/usr/share/hplip/ui5/setupdialog.py", line 222, in initUi
    self.initDiscoveryPage()
  File "/usr/share/hplip/ui5/setupdialog.py", line 260, in initDiscoveryPage
    if self.manualDiscovery():
  File "/usr/share/hplip/ui5/setupdialog.py", line 340, in manualDiscovery
    device_uri, sane_uri, fax_uri = device.makeURI(self.param, self.jd_port)
  File "/usr/share/hplip/base/device.py", line 417, in makeURI
    mq = queryModelByURI(cups_uri)
  File "/usr/share/hplip/base/device.py", line 458, in queryModelByURI
    return queryModelByModel(model)
  File "/usr/share/hplip/base/device.py", line 447, in queryModelByModel
    return model_dat[model]
  File "/usr/share/hplip/base/models.py", line 565, in __getitem__
    if self.read_section(self.released_dat, model):
  File "/usr/share/hplip/base/models.py", line 475, in read_section
    fd = open(filename)
TypeError: expected str, bytes or os.PathLike object, not NoneType

Revision history for this message
Manfred Hampl (m-hampl) said :
#14

This again is strange.
It looks as if HPLIP is not correctly installed.

If you can print "driverless", then you probably better use that.

Revision history for this message
Richard Trinkner (trinkner) said :
#15

I suspect that the Python version problems in HP's installation routine prevented some files from being installed. Hopefully they'll figure it out for the next version of hplip.

Thanks for your help, Manfred!

Richard

Revision history for this message
shivani mandora (shivani1708) said :
#16

Hi,

Can you please install plugin through sh command instead of hp-plugin:

$sh hplip-3.20.5.plugin.run

Revision history for this message
David Escandon (daescandon) said :
#17

Hi,

I believe this is a bug. I still cannot get the hpplugin to work. My output:

escandon@escandon-Inspiron-One-2320:~$ hp-setup

HP Linux Imaging and Printing System (ver. 3.20.5)
Printer/Fax Setup Utility ver. 9.0

Copyright (c) 2001-18 HP Development Company, LP
This software comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to distribute it
under certain conditions. See COPYING file for more details.

Searching... (bus=net, timeout=5, ttl=4, search=(None) desc=0, method=slp)

HP Linux Imaging and Printing System (ver. 3.20.5)
Plugin Download and Install Utility ver. 2.1

Copyright (c) 2001-18 HP Development Company, LP
This software comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to distribute it
under certain conditions. See COPYING file for more details.

HP Linux Imaging and Printing System (ver. 3.20.5)
Plugin Download and Install Utility ver. 2.1

Copyright (c) 2001-18 HP Development Company, LP
This software comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to distribute it
under certain conditions. See COPYING file for more details.

Checking for network connection...
Downloading plug-in from:
Traceback (most recent call last):
  File "/usr/share/hplip/base/password.py", line 85, in get_distro_name
    os_name = platform.dist()[0]
AttributeError: module 'platform' has no attribute 'dist'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/share/hplip/ui5/plugindialog.py", line 248, in NextButton_clicked
    status, download_plugin_file, error_str = self.pluginObj.download(self.plugin_path,self.plugin_download_callback)
  File "/usr/share/hplip/installer/pluginhandler.py", line 254, in download
    core = core_install.CoreInstall()
  File "/usr/share/hplip/installer/core_install.py", line 240, in __init__
    self.passwordObj = password.Password(ui_mode)
  File "/usr/share/hplip/base/password.py", line 118, in __init__
    self.__readAuthType() # self.__authType
  File "/usr/share/hplip/base/password.py", line 141, in __readAuthType
    distro_name = get_distro_name().lower().replace(" ","")
  File "/usr/share/hplip/base/password.py", line 88, in get_distro_name
    os_name = distro.linux_distribution()[0]
  File "/usr/lib/python3/dist-packages/distro.py", line 122, in linux_distribution
    return _distro.linux_distribution(full_distribution_name)
  File "/usr/lib/python3/dist-packages/distro.py", line 677, in linux_distribution
    self.version(),
  File "/usr/lib/python3/dist-packages/distro.py", line 737, in version
    self.lsb_release_attr('release'),
  File "/usr/lib/python3/dist-packages/distro.py", line 899, in lsb_release_attr
    return self._lsb_release_info.get(attribute, '')
  File "/usr/lib/python3/dist-packages/distro.py", line 552, in __get__
    ret = obj.__dict__[self._fname] = self._f(obj)
  File "/usr/lib/python3/dist-packages/distro.py", line 1012, in _lsb_release_info
    stdout = subprocess.check_output(cmd, stderr=devnull)
  File "/usr/lib/python3.8/subprocess.py", line 411, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
  File "/usr/lib/python3.8/subprocess.py", line 512, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '('lsb_release', '-a')' returned non-zero exit status 1.
Error in sys.excepthook:
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 144, in apport_excepthook
    with os.fdopen(os.open(pr_filename,
PermissionError: [Errno 13] Permission denied: '/var/crash/_usr_share_hplip_plugin.py.1000.crash'

Original exception was:
Traceback (most recent call last):
  File "/usr/share/hplip/base/password.py", line 85, in get_distro_name
    os_name = platform.dist()[0]
AttributeError: module 'platform' has no attribute 'dist'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/share/hplip/ui5/plugindialog.py", line 248, in NextButton_clicked
    status, download_plugin_file, error_str = self.pluginObj.download(self.plugin_path,self.plugin_download_callback)
  File "/usr/share/hplip/installer/pluginhandler.py", line 254, in download
    core = core_install.CoreInstall()
  File "/usr/share/hplip/installer/core_install.py", line 240, in __init__
    self.passwordObj = password.Password(ui_mode)
  File "/usr/share/hplip/base/password.py", line 118, in __init__
    self.__readAuthType() # self.__authType
  File "/usr/share/hplip/base/password.py", line 141, in __readAuthType
    distro_name = get_distro_name().lower().replace(" ","")
  File "/usr/share/hplip/base/password.py", line 88, in get_distro_name
    os_name = distro.linux_distribution()[0]
  File "/usr/lib/python3/dist-packages/distro.py", line 122, in linux_distribution
    return _distro.linux_distribution(full_distribution_name)
  File "/usr/lib/python3/dist-packages/distro.py", line 677, in linux_distribution
    self.version(),
  File "/usr/lib/python3/dist-packages/distro.py", line 737, in version
    self.lsb_release_attr('release'),
  File "/usr/lib/python3/dist-packages/distro.py", line 899, in lsb_release_attr
    return self._lsb_release_info.get(attribute, '')
  File "/usr/lib/python3/dist-packages/distro.py", line 552, in __get__
    ret = obj.__dict__[self._fname] = self._f(obj)
  File "/usr/lib/python3/dist-packages/distro.py", line 1012, in _lsb_release_info
    stdout = subprocess.check_output(cmd, stderr=devnull)
  File "/usr/lib/python3.8/subprocess.py", line 411, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
  File "/usr/lib/python3.8/subprocess.py", line 512, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '('lsb_release', '-a')' returned non-zero exit status 1.

Done.
error: The device you are trying to setup requires a binary plug-in. Some functionalities may not work as expected without plug-ins. Please run 'hp-plugin' as normal user to install plug-ins. Visit http://hplipopensource.com for more infomation.

Only way to print is through the driverless method.

ideas????

Revision history for this message
vishal (zvesda1) said :
#18

I think I also have the same issue. HP Plugin doesn't install . Infact from the GUI menu printer get recognised but the next step that prompts to install plugin doesn't appear at all.

Revision history for this message
vishal (zvesda1) said :
#19

This is my log:
hp-check[6869]: info: :
hp-check[6869]: info: :HP Linux Imaging and Printing System (ver. 3.20.6)
hp-check[6869]: info: :Dependency/Version Check Utility ver. 15.1
hp-check[6869]: info: :
hp-check[6869]: info: :Copyright (c) 2001-18 HP Development Company, LP
hp-check[6869]: info: :This software comes with ABSOLUTELY NO WARRANTY.
hp-check[6869]: info: :This is free software, and you are welcome to distribute it
hp-check[6869]: info: :under certain conditions. See COPYING file for more details.
hp-check[6869]: info: :
hp-check[6869]: info: :Note: hp-check can be run in three modes:
hp-check[6869]: info: :1. Compile-time check mode (-c or --compile): Use this mode before compiling the
hp-check[6869]: info: :HPLIP supplied tarball (.tar.gz or .run) to determine if the proper dependencies
hp-check[6869]: info: :are installed to successfully compile HPLIP.
hp-check[6869]: info: :2. Run-time check mode (-r or --run): Use this mode to determine if a distro
hp-check[6869]: info: :supplied package (.deb, .rpm, etc) or an already built HPLIP supplied tarball
hp-check[6869]: info: :has the proper dependencies installed to successfully run.
hp-check[6869]: info: :3. Both compile- and run-time check mode (-b or --both) (Default): This mode
hp-check[6869]: info: :will check both of the above cases (both compile- and run-time dependencies).
hp-check[6869]: info: :
hp-check[6869]: info: :Check types:
hp-check[6869]: info: :a. EXTERNALDEP - External Dependencies
hp-check[6869]: info: :b. GENERALDEP - General Dependencies (required both at compile and run time)
hp-check[6869]: info: :c. COMPILEDEP - Compile time Dependencies
hp-check[6869]: info: :d. [All are run-time checks]
hp-check[6869]: info: :PYEXT SCANCONF QUEUES PERMISSION
hp-check[6869]: info: :
hp-check[6869]: info: :Status Types:
hp-check[6869]: info: : OK
hp-check[6869]: info: : MISSING - Missing Dependency or Permission or Plug-in
hp-check[6869]: info: : INCOMPAT - Incompatible dependency-version or Plugin-version
hp-check[6869]: info: :
hp-check[6869]: info: :
hp-check[6869]: info: :---------------
hp-check[6869]: info: :| SYSTEM INFO |
hp-check[6869]: info: :---------------
hp-check[6869]: info: :
hp-check[6869]: info: : Kernel: 5.4.0-42-generic #46-Ubuntu SMP Fri Jul 10 00:24:02 UTC 2020 GNU/Linux
 Host: vishal-ZenBook-UM431DA
 Proc: 5.4.0-42-generic #46-Ubuntu SMP Fri Jul 10 00:24:02 UTC 2020 GNU/Linux
 Distribution: 12 20.04
hp-check[6869]: info: : Bitness: 64 bit

hp-check[6869]: info: :
hp-check[6869]: info: :-----------------------
hp-check[6869]: info: :| HPLIP CONFIGURATION |
hp-check[6869]: info: :-----------------------
hp-check[6869]: info: :
hp-check[6869]: info: :HPLIP-Version: HPLIP 3.20.6
hp-check[6869]: info: :HPLIP-Home: /usr/share/hplip
hp-check[6869]: info: :HPLIP-Installation: Auto installation is supported for ubuntu distro 20.04 version
hp-check[6869]: info: :
hp-check[6869]: info: :Current contents of '/etc/hp/hplip.conf' file:
hp-check[6869]: info: :# hplip.conf. Generated from hplip.conf.in by configure.

[hplip]
version=3.20.6

[dirs]
home=/usr/share/hplip
run=/var/run
ppd=/usr/share/ppd/HP
ppdbase=/usr/share/ppd
doc=/usr/share/doc/hplip-3.20.6
html=/usr/share/doc/hplip-3.20.6
icon=/usr/share/applications
cupsbackend=/usr/lib/cups/backend
cupsfilter=/usr/lib/cups/filter
drv=/usr/share/cups/drv/hp
bin=/usr/bin
apparmor=/etc/apparmor.d
# Following values are determined at configure time and cannot be changed.
[configure]
network-build=yes
libusb01-build=no
pp-build=no
gui-build=yes
scanner-build=yes
fax-build=yes
dbus-build=yes
cups11-build=no
doc-build=yes
shadow-build=no
hpijs-install=no
foomatic-drv-install=no
foomatic-ppd-install=no
foomatic-rip-hplip-install=no
hpcups-install=yes
cups-drv-install=yes
cups-ppd-install=no
internal-tag=3.20.6
restricted-build=no
ui-toolkit=qt5
qt3=no
qt4=no
qt5=yes
policy-kit=no
lite-build=no
udev_sysfs_rules=no
hpcups-only-build=no
hpijs-only-build=no
apparmor_build=yes
class-driver=no

hp-check[6869]: info: :
hp-check[6869]: info: :Current contents of '/var/lib/hp/hplip.state' file:
hp-check[6869]: info: :Plugins are not installed. Could not access file: No such file or directory
hp-check[6869]: info: :
hp-check[6869]: info: :Current contents of '~/.hplip/hplip.conf' file:
hp-check[6869]: info: :[commands]
scan = /usr/bin/xsane -V %SANE_URI%

[fax]
email_address =
voice_phone =

[last_used]
device_uri =
printer_name =
working_dir = .

[polling]
device_list =
enable = false
interval = 5

[refresh]
enable = false
rate = 30
type = 1

[settings]
systray_messages = 0
systray_visible = 0

[upgrade]
last_upgraded_time = 1595572912
notify_upgrade = true
pending_upgrade_time = 0

[installation]
date_time = 07/27/20 19:22:28
version = 3.20.6

hp-check[6869]: info: : <Package-name> <Package-Desc> <Required/Optional> <Min-Version> <Installed-Version> <Status> <Comment>
hp-check[6869]: info: :
hp-check[6869]: info: :-------------------------
hp-check[6869]: info: :| External Dependencies |
hp-check[6869]: info: :-------------------------
hp-check[6869]: info: :
hp-check[6869]: info: : cups CUPS - Common Unix Printing System REQUIRED 1.1 2.3.1 OK 'CUPS Scheduler is running'
hp-check[6869]: info: : gs GhostScript - PostScript and PDF language interpreter and previewer REQUIRED 7.05 9.50 OK -
hp-check[6869]: info: : xsane xsane - Graphical scanner frontend for SANE OPTIONAL 0.9 0.999 OK -
hp-check[6869]: info: : scanimage scanimage - Shell scanning program OPTIONAL 1.0 1.0.29 OK -
hp-check[6869]: info: : dbus DBus - Message bus system REQUIRED - 1.12.16 OK -
hp-check[6869]: info: : policykit PolicyKit - Administrative policy framework OPTIONAL - 0.105 OK -
hp-check[6869]: info: : network network -wget OPTIONAL - 1.20.3 OK -
hp-check[6869]: info: : avahi-utils avahi-utils OPTIONAL - 0.7 OK -
hp-check[6869]: info: :
hp-check[6869]: info: :------------------------
hp-check[6869]: info: :| General Dependencies |
hp-check[6869]: info: :------------------------
hp-check[6869]: info: :
hp-check[6869]: info: : libjpeg libjpeg - JPEG library REQUIRED - - OK -
hp-check[6869]: info: : cups-devel CUPS devel- Common Unix Printing System development files REQUIRED - 2.3.1 OK -
hp-check[6869]: info: : cups-image CUPS image - CUPS image development files REQUIRED - 2.3.1 OK -
hp-check[6869]: info: : libpthread libpthread - POSIX threads library REQUIRED - b'2.31' OK -
hp-check[6869]: info: : libusb libusb - USB library REQUIRED - 1.0 OK -
hp-check[6869]: info: : sane SANE - Scanning library REQUIRED - - OK -
hp-check[6869]: info: : sane-devel SANE - Scanning library development files REQUIRED - - OK -
hp-check[6869]: info: : libnetsnmp-devel libnetsnmp-devel - SNMP networking library development files REQUIRED 5.0.9 5.8 OK -
hp-check[6869]: info: : libcrypto libcrypto - OpenSSL cryptographic library REQUIRED - 1.1.1 OK -
hp-check[6869]: info: : python3X Python 2.2 or greater - Python programming language REQUIRED 2.2 3.8.2 OK -
hp-check[6869]: info: : python3-notify2 Python libnotify - Python bindings for the libnotify Desktop notifications OPTIONAL - - OK -
hp-check[6869]: info: : python3-pyqt5-dbus PyQt 5 DBus - DBus Support for PyQt5 OPTIONAL 5.0 5.14.1 OK -
hp-check[6869]: info: : python3-pyqt5 PyQt 5- Qt interface for Python (for Qt version 4.x) REQUIRED 5.0 5.14.1 OK -
hp-check[6869]: info: : python3-dbus Python DBus - Python bindings for DBus REQUIRED 0.80.0 1.2.16 OK -
hp-check[6869]: info: : python3-xml Python XML libraries REQUIRED - 2.2.9 OK -
hp-check[6869]: info: : python3-devel Python devel - Python development files REQUIRED 2.2 3.8.2 OK -
hp-check[6869]: info: : python3-pil PIL - Python Imaging Library (required for commandline scanning with hp-scan) OPTIONAL - 7.0.0 OK -
hp-check[6869]: info: : python3-reportlab Reportlab - PDF library for Python OPTIONAL 2.0 3.5.34 OK -
hp-check[6869]: info: :
hp-check[6869]: info: :--------------
hp-check[6869]: info: :| COMPILEDEP |
hp-check[6869]: info: :--------------
hp-check[6869]: info: :
hp-check[6869]: info: : libtool libtool - Library building support services REQUIRED - 2.4.6 OK -
hp-check[6869]: info: : gcc gcc - GNU Project C and C++ Compiler REQUIRED - 9.3.0 OK -
hp-check[6869]: info: : make make - GNU make utility to maintain groups of programs REQUIRED 3.0 4.2.1 OK -
hp-check[6869]: info: :
hp-check[6869]: info: :---------------------
hp-check[6869]: info: :| Python Extentions |
hp-check[6869]: info: :---------------------
hp-check[6869]: info: :
hp-check[6869]: info: : cupsext CUPS-Extension REQUIRED - 3.20.6 OK -
hp-check[6869]: info: : hpmudext IO-Extension REQUIRED - 3.20.6 OK -
hp-check[6869]: info: :
hp-check[6869]: info: :----------------------
hp-check[6869]: info: :| Scan Configuration |
hp-check[6869]: info: :----------------------
hp-check[6869]: info: :
hp-check[6869]: info: : hpaio HPLIP-SANE-Backend REQUIRED - 3.20.6 OK 'hpaio found in /etc/sane.d/dll.conf'
hp-check[6869]: info: : scanext Scan-SANE-Extension REQUIRED - 3.20.6 OK -
hp-check[6869]: info: :
hp-check[6869]: info: :------------------------------
hp-check[6869]: info: :| DISCOVERED SCANNER DEVICES |
hp-check[6869]: info: :------------------------------
hp-check[6869]: info: :
hp-check[6869]: info: :device `hpaio:/usb/HP_LaserJet_Professional_M1213nf_MFP?serial=000000000QJ21FG3PR1a' is a Hewlett-Packard HP_LaserJet_Professional_M1213nf_MFP all-in-one

hp-check[6869]: info: :
hp-check[6869]: info: :--------------------------
hp-check[6869]: info: :| DISCOVERED USB DEVICES |
hp-check[6869]: info: :--------------------------
hp-check[6869]: info: :
hp-check[6869]: info: : Device URI Model
hp-check[6869]: info: : -------------------------------- --------------------------------
hp-check[6869]: info: : hp:/usb/HP_LaserJet_Professional HP LaserJet Professional M1213nf
  _M1213nf_MFP?serial=000000000QJ2 MFP
  1FG3PR1a
hp-check[6869]: info: :
hp-check[6869]: info: :---------------------------------
hp-check[6869]: info: :| INSTALLED CUPS PRINTER QUEUES |
hp-check[6869]: info: :---------------------------------
hp-check[6869]: info: :
hp-check[6869]: info: :
hp-check[6869]: info: :lpstat
hp-check[6869]: info: :------
hp-check[6869]: info: :Type: Unknown
hp-check[6869]: info: :Device URI: No destinations added.
hp-check[6869]: info: :
hp-check[6869]: info: :
hp-check[6869]: info: :--------------
hp-check[6869]: info: :| PERMISSION |
hp-check[6869]: info: :--------------
hp-check[6869]: info: :
hp-check[6869]: info: :USB None Required - - OK Node:'/dev/bus/usb/001/024' Perm:' root lp rw- rw- rw- rw- r--'
hp-check[6869]: info: :No errors or warnings.
hp-check[6869]: info: :
hp-check[6869]: info: :Done.

Revision history for this message
Rob (rob-drrob1) said :
#20

I have the same issue.

Has anyone been able to get hplip 3.20.6 to install correctly?

Revision history for this message
Sasa Vilic (sasavilic) said :
#21

I have same issue with 3.21.2 and installing pluging. And the cause is apparmor policy:

audit: type=1400 audit(1615326403.939:63): apparmor="DENIED" operation="exec" profile="/usr/share/hplip/plugin.py" name="/usr/bin/dpkg-query" pid=3506 comm="lsb_release" requested_mask="x" denied_mask="x" fsuid=1000 ouid=0

Revision history for this message
Patrick Gosling (jpmg1) said :
#22

This can be easily fixed by adding the line
     /{,usr/}bin/dpkg-query rix,
immediately below the line
     /{,usr/}bin/dpkg-architecture rix,
in /etc/apparmor.d/usr.share.hplip

(if you don't want to then reboot, you'll also have to force that apparmor profile to reload)

Revision history for this message
Sasa Vilic (sasavilic) said :
#23

I did that, but then other issues with apparmor pop up. The apparmor policy is just not tested again all code paths, I guess.

Revision history for this message
Rob (rob-drrob1) said :
#24

I was able to work around this by finally upgrading to Ubuntu 20.04.1. First I booted to a live environment and saw that my printer worked as expected. So I figured that the problem has been fixed.

So I did an upgrade install to linuxmint 20, as I was on linuxming 19.3.

My printer started to work as I need. I have since upgraded to linuxmine 20.1, and all is working as expected.

I don't know how it was fixed, but it is working.

Can you help with this problem?

Provide an answer of your own, or ask Richard Trinkner for more information if necessary.

To post a message you must log in.