Score:1

Error installing HP printer 1020 plus plug-in

cy flag

I am trying to install a plugin which appears to be mandatory to be able to use HP 1020 plus printer. Upon running the command hp-plugin, I get an error messsage. Posting the full output below:

Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use
QT_QPA_PLATFORM=wayland to run on Wayland anyway. Checking for network
connection... Downloading plug-in from: None Traceback (most recent
call last):   File "/usr/share/hplip/base/password.py", line 89, 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 257, in
download
    core = core_install.CoreInstall()   File "/usr/share/hplip/installer/core_install.py", line 241, in __init__
    self.passwordObj = password.Password(ui_mode)   File "/usr/share/hplip/base/password.py", line 122, in __init__
    self.__readAuthType()  # self.__authType   File "/usr/share/hplip/base/password.py", line 145, in __readAuthType
    distro_name = get_distro_name().lower().replace(" ","")   File "/usr/share/hplip/base/password.py", line 92, in get_distro_name
    os_name = distro.linux_distribution()[0]   File "/usr/lib/python3/dist-packages/distro.py", line 125, in
linux_distribution
    return _distro.linux_distribution(full_distribution_name)   File "/usr/lib/python3/dist-packages/distro.py", line 681, in
linux_distribution
    self.version(),   File "/usr/lib/python3/dist-packages/distro.py", line 741, in version
    self.lsb_release_attr('release'),   File "/usr/lib/python3/dist-packages/distro.py", line 903, in
lsb_release_attr
    return self._lsb_release_info.get(attribute, '')   File "/usr/lib/python3/dist-packages/distro.py", line 556, in __get__
    ret = obj.__dict__[self._fname] = self._f(obj)   File "/usr/lib/python3/dist-packages/distro.py", line 1014, in
_lsb_release_info
    stdout = subprocess.check_output(cmd, stderr=devnull)   File "/usr/lib/python3.9/subprocess.py", line 424, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,   File "/usr/lib/python3.9/subprocess.py", line 528, 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 153, 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 89, 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 257, in
download
    core = core_install.CoreInstall()   File "/usr/share/hplip/installer/core_install.py", line 241, in __init__
    self.passwordObj = password.Password(ui_mode)   File "/usr/share/hplip/base/password.py", line 122, in __init__
    self.__readAuthType()  # self.__authType   File "/usr/share/hplip/base/password.py", line 145, in __readAuthType
    distro_name = get_distro_name().lower().replace(" ","")   File "/usr/share/hplip/base/password.py", line 92, in get_distro_name
    os_name = distro.linux_distribution()[0]   File "/usr/lib/python3/dist-packages/distro.py", line 125, in
linux_distribution
    return _distro.linux_distribution(full_distribution_name)   File "/usr/lib/python3/dist-packages/distro.py", line 681, in
linux_distribution
    self.version(),   File "/usr/lib/python3/dist-packages/distro.py", line 741, in version
    self.lsb_release_attr('release'),   File "/usr/lib/python3/dist-packages/distro.py", line 903, in
lsb_release_attr
    return self._lsb_release_info.get(attribute, '')   File "/usr/lib/python3/dist-packages/distro.py", line 556, in __get__
    ret = obj.__dict__[self._fname] = self._f(obj)   File "/usr/lib/python3/dist-packages/distro.py", line 1014, in
_lsb_release_info
    stdout = subprocess.check_output(cmd, stderr=devnull)   File "/usr/lib/python3.9/subprocess.py", line 424, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,   File "/usr/lib/python3.9/subprocess.py", line 528, in run
    raise CalledProcessError(retcode, process.args, subprocess.CalledProcessError: Command '('lsb_release', '-a')'
returned non-zero exit status 1. Checking for network connection...
Downloading plug-in from: None Traceback (most recent call last):  
File "/usr/share/hplip/base/password.py", line 89, 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 257, in
download
    core = core_install.CoreInstall()   File "/usr/share/hplip/installer/core_install.py", line 241, in __init__
    self.passwordObj = password.Password(ui_mode)   File "/usr/share/hplip/base/password.py", line 122, in __init__
    self.__readAuthType()  # self.__authType   File "/usr/share/hplip/base/password.py", line 145, in __readAuthType
    distro_name = get_distro_name().lower().replace(" ","")   File "/usr/share/hplip/base/password.py", line 92, in get_distro_name
    os_name = distro.linux_distribution()[0]   File "/usr/lib/python3/dist-packages/distro.py", line 125, in
linux_distribution
    return _distro.linux_distribution(full_distribution_name)   File "/usr/lib/python3/dist-packages/distro.py", line 681, in
linux_distribution
    self.version(),   File "/usr/lib/python3/dist-packages/distro.py", line 741, in version
    self.lsb_release_attr('release'),   File "/usr/lib/python3/dist-packages/distro.py", line 903, in
lsb_release_attr
    return self._lsb_release_info.get(attribute, '')   File "/usr/lib/python3/dist-packages/distro.py", line 556, in __get__
    ret = obj.__dict__[self._fname] = self._f(obj)   File "/usr/lib/python3/dist-packages/distro.py", line 1014, in
_lsb_release_info
    stdout = subprocess.check_output(cmd, stderr=devnull)   File "/usr/lib/python3.9/subprocess.py", line 424, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,   File "/usr/lib/python3.9/subprocess.py", line 528, 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 153, 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 89, 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 257, in
download
    core = core_install.CoreInstall()   File "/usr/share/hplip/installer/core_install.py", line 241, in __init__
    self.passwordObj = password.Password(ui_mode)   File "/usr/share/hplip/base/password.py", line 122, in __init__
    self.__readAuthType()  # self.__authType   File "/usr/share/hplip/base/password.py", line 145, in __readAuthType
    distro_name = get_distro_name().lower().replace(" ","")   File "/usr/share/hplip/base/password.py", line 92, in get_distro_name
    os_name = distro.linux_distribution()[0]   File "/usr/lib/python3/dist-packages/distro.py", line 125, in
linux_distribution
    return _distro.linux_distribution(full_distribution_name)   File "/usr/lib/python3/dist-packages/distro.py", line 681, in
linux_distribution
    self.version(),   File "/usr/lib/python3/dist-packages/distro.py", line 741, in version
    self.lsb_release_attr('release'),   File "/usr/lib/python3/dist-packages/distro.py", line 903, in
lsb_release_attr
    return self._lsb_release_info.get(attribute, '')   File "/usr/lib/python3/dist-packages/distro.py", line 556, in __get__
    ret = obj.__dict__[self._fname] = self._f(obj)   File "/usr/lib/python3/dist-packages/distro.py", line 1014, in
_lsb_release_info
    stdout = subprocess.check_output(cmd, stderr=devnull)   File "/usr/lib/python3.9/subprocess.py", line 424, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,   File "/usr/lib/python3.9/subprocess.py", line 528, in run
    raise CalledProcessError(retcode, process.args, subprocess.CalledProcessError: Command '('lsb_release', '-a')'
returned non-zero exit status 1.

I am using Ubuntu 21.10. I am a novice, and have no clue about this. Could someone please help? Thanks so much!


echo $PATH returns /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/snap/bin

and which python3 returns /usr/bin/python3
which python and which python2 don't return anything .

N0rbert avatar
zw flag
At first install HPLIP GUI by `sudo apt-get install hplip-gui`. Then try to logout, login to *Ubuntu on Xorg* session and retry running `hp-plugin`.
user90041 avatar
cy flag
@N0rbert Thanks. I installed hplip-gui, and rebooted my computer. Upon running ```hp-plugin``` it still shows the same error :-(
N0rbert avatar
zw flag
Do you have Anaconda installed? What is the output of `echo $PATH` ; `which python`; `which python3`; `which python2`?
user90041 avatar
cy flag
@N0rbert I don't have Anaconda. Should I install it? ```echo $PATH``` returns /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/snap/bin and ```which python3``` returns /usr/bin/python3 ```which python``` and ```which python2``` don't return anything.
N0rbert avatar
zw flag
All your output looks correct. Anaconda is not needed, but it may cause problems with Python. It is good that it is not installed. Do you remember how HPLIP was installed for first time? Do you use their binary installer or Ubuntu deb-package?
user90041 avatar
cy flag
@N0rbert Not fully sure, but I think I had run ```sudo apt-get install hplip```
N0rbert avatar
zw flag
Let us [continue this discussion in chat](https://chat.stackexchange.com/rooms/132103/discussion-between-n0rbert-and-user90041).
Score:1
zw flag

During chat session we discovered the following.

The problem was caused by a mix of binary installed HPLIP 3.21.10 and deb-packaged 3.21.6 version.

So we found HPLIP 3.21.10 distribution by find ~ -name hplip-3.21.10.run - got /home/mathphy226/softwares/hplip-3.21.10.run. Then asked it for self-removal as follows:

cd /home/mathphy226/softwares
sh hplip-3.21.10.run --noexec
cd hplip-3.21.10
sudo hp-uninstall
sudo python3 ./uninstall.py

sudo apt autopurge
sudo rm -vrf /usr/share/hplip/
sudo rm -rfv ~/.hplip /root/.hplip
sudo rm -v /usr/share/hal/fdi/preprobe/10osvendor/20-hplip-devices.fdi
sudo rm -v /usr/lib64/sane/libsane-hpgt2500-x86_64.so.1.0.27 /usr/lib64/sane/hpgt2500_ntdcmsdll-x86_64.so /usr/lib64/sane/libsane-hp2000S1-x86_64.so.1.0.25
sudo rm -v /usr/share/ipp-usb/quirks/HPLIP.conf /usr/share/hal/fdi/preprobe/10osvendor/20-hplip-devices.fdi /usr/share/cups/mime/pstotiff.types /usr/share/cups/mime/pstotiff.convs
sudo rm -v /etc/udev/rules.d/40-libsane.rules
sudo rm -v /etc/apparmor.d/local/usr.sbin.cups-browsed /etc/apparmor.d/local/usr.sbin.cupsd
sudo rm -v /etc/cups/raw.convs /etc/cups/raw.types /etc/cups/subscriptions.conf.O /etc/cups/subscriptions.conf /etc/cups/cupsd.conf
sudo rm -v /usr/lib/libhpdiscovery.la /usr/lib/libImageProcessor-x86_64.so /usr/lib/libhpipp.so.0.0.1 /usr/lib/libhpdiscovery.so.0.0.1 /usr/lib/libhpipp.la
sudo rm -v /usr/lib/cups/backend/snmp /usr/lib/cups/backend/usb /usr/lib/cups/backend/dnssd /usr/lib/cups/backend/mdns /usr/lib/cups/backend/socket /usr/lib/cups/backend/lpd
sudo rm -v /usr/lib/sane/libsane-hpgt2500-x86_64.so.1.0.27 /usr/lib/sane/hpgt2500_ntdcmsdll-x86_64.so

sudo apt-get autopurge hplip hplip-data hplip-doc hplip-gui hpijs-ppds libsane-hpaio printer-driver-hpcups printer-driver-hpijs

sudo rm -vrf /usr/local/bin/{chardetect,coloredlogs,dumppdf.py,f2py,f2py3,f2py3.9,humanfriendly,imageio_download_bin,imageio_remove_bin,img2pdf,img2pdf-gui,lsm2bin,ocrmypdf,pdf2txt.py,pip,pip3,pip3.9,__pycache__,range-detector,skivi,tiff2fsspec,tiffcomment,tifffile,tqdm}
sudo rm -vrf /usr/local/lib/{libjpeg-x86_64.so.9.2.0,libjpeg.so.9}
sudo rm -vrf /usr/local/lib/python3.9/dist-packages/{_cffi_backend.cpython-39-x86_64-linux-gnu.so,cffi,cffi-1.15.0.dist-info,cffi.libs,chardet,chardet-4.0.0.dist-info,cryptography,cryptography-36.0.0.dist-info,pycparser,pycparser-2.21.dist-info,coloredlogs,coloredlogs-15.0.1.dist-info,coloredlogs.pth,cv2,doc,humanfriendly,humanfriendly-10.0.dist-info,imageio,imageio-2.13.1.dist-info,img2pdf-0.4.3.dist-info,img2pdf.py,imutils,imutils-0.5.4.dist-info,jp2.py,lxml,lxml-4.6.4.dist-info,networkx,networkx-2.6.3.dist-info,numpy,numpy-1.21.4.dist-info,numpy.libs,ocrmypdf,ocrmypdf-13.0.0.dist-info,opencv_python-4.5.4.60.dist-info,opencv_python.libs,packaging,packaging-21.3.dist-info,pdfminer,pdfminer.six-20211012.dist-info,pikepdf,pikepdf-4.1.0.dist-info,pikepdf.libs,PIL,Pillow-8.4.0.dist-info,Pillow.libs,pip,pip-21.3.1.dist-info,pluggy,pluggy-1.0.0.dist-info,__pycache__,pyparsing,pyparsing-3.0.6.dist-info,PyPDF2,PyPDF2-1.26.0.dist-info,PyWavelets-1.2.0.dist-info,pywt,scikit_image-0.19.0.dist-info,scikit_image.libs,scipy,scipy-1.7.3.dist-info,scipy.libs,skimage,tesserocr-2.5.2.dist-info,tesserocr.cpython-39-x86_64-linux-gnu.so,tifffile,tifffile-2021.11.2.dist-info,tqdm,tqdm-4.62.3.dist-info,imageio-2.13.2.dist-info,ocrmypdf-13.1.0.dist-info}
sudo rm -vrf /usr/local/share/doc/networkx-2.6.3

Then reboot to get deb-packaged HPLIP 3.21.6 reinstalled with

sudo apt-get -o Dpkg::Options::="--force-confask" install --reinstall --no-install-recommends --no-install-suggests hplip hplip-data hplip-doc hplip-gui hpijs-ppds libsane-hpaio printer-driver-hpcups printer-driver-hpijs

and manually downloaded HPLIP plugin by

cd /home/mathphy226/softwares
wget -c https://developers.hp.com/sites/default/files/hplip-3.21.6-plugin.run
wget -c https://developers.hp.com/sites/default/files/hplip-3.21.6-plugin.run.asc

to install it later with hp-plugin -i .

Additional note: according to official HP docs this HP 1020 plus printer needs HPLIP >= 2.7.10, so binary HPLIP is not needed.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.