hp-plugin Error "AttributeError: module 'platform' has no attribute 'dist'"

Asked by Lubomir Bielik on 2020-08-03

My printer is in "Busy" state all the time now. My scanner doesnot work, so I install latest version 3.20.6 of phlip software. During installation I get this error in hp-plugin program: 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'.
My OS: Ubuntu 20.04.1 LTS
Printer: HP LaserJet Profesional M1132 MFP
HPLIP: 3.20.6
I reproduce this error with second run of hp-setup program.

Question information

English Edit question
HPLIP Edit question
No assignee Edit question
Solved by:
Lubomir Bielik
Last query:
Last reply:
Manfred Hampl (m-hampl) said : #1

If you are running Ubuntu 20.04, then you probably better install HPLIP version 3.20.3 from the Ubuntu repositories (unless you need the changes that have been made between 3.20.3 and 3.20.6)

sudo apt install hplip hplip-gui

Lubomir Bielik (lbielik) said : #2

I uninstall hplip 3.20.6 and install hplip as you suggested. And I am basically in v previous state after fresh install of Ubuntu. Printer prints nothing (printer job is stopped) and Document Scanner prints "Additional software needed You need to install driver software for your scanner". I press "install driver software" and get "Driver installed succesfully! Once installed you will need to restart this app." I restart Document Scanner and Scanner prints "Additional software needed You need to install driver software for your scanner". And I am in loop.

Lubomir Bielik (lbielik) said : #3

After many experiments this article helps me:

Here is recap what I did:
Purge existing HP software from the binary:
sudo apt-get purge hplip hplip-data hplip-doc hplip-gui hpijs-ppds libsane-hpaio printer-driver-hpcups printer-driver-hpijs

Remove directory (if it exists):
sudo rm -rf /usr/share/hplip/
I remove in addition this one:
rm /home/<my home dir>/.hplip

Remove packages no longer required:
sudo apt-get autoremove

restart notebook:

Install the HP graphical user interface:
sudo apt-get install hplip-gui

Switch on printer and start HPLIP Toolbox application and follow instruction. At the end do not check "Print test page".
After that I try print some document a and scan with Document scanner application and both are working.