Error trying to install hp-plugin Ubuntu20.04, hplip 3.20.3 and 3.20.5

Asked by Daniel Day

I have an HP laserjet Pro MFP m225dn. Worked fine with 18.04. In 20.04, does not recognize scanner etc..
I get the following error when trying to install the plugin with the 3.20.3 version that downloaded with Ubuntu, and after uninstalling with apt and trying 3.20.5, same problem.

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.

Any ideas?

Question information

Language:
English Edit question
Status:
Solved
For:
HPLIP Edit question
Assignee:
No assignee Edit question
Solved by:
Daniel Day
Solved:
Last query:
Last reply:
Revision history for this message
brian_p (claremont102) said :
#1

Download a plugin file from

 https://www.openprinting.org/download/printdriver/auxfiles/HP/plugins/.

Install with

 sudo sh DOWNLOADED_FILE

Brian.

Revision history for this message
Daniel Day (danielday) said :
#2

Thank you very much Brian.
OK, I had this plugin already and now I ran it with sh. It gave me an OK:

"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."

The HP toolbox/device manager still asks for a plugin install, but HP-check indicates no problems and I can print and scan. Thanks and have a good evening!
Daniel

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

The problem is apparmor:

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