hplip not working on fresh Ubuntu 20.04 installation
Solution 1:
You have to install python3 and all the toolkits.
sudo apt install python3-pip
sudo apt-get install --assume-yes python3-pyqt5
sudo apt-get install --assume-yes python3-dbus.mainloop.pyqt5
sudo apt-get install --assume-yes python3-notify
Then when you run hplip
respond "no" to the failed install of the old python.
sh hplip-3.20.9.run
and finally:
sudo apt-get install libcanberra-gtk-module
which seems to be necessary, although I don't know why. Delete your printer then reinstall, and it should work.
Solution 2:
Try this:
Download the file to ~/Dowloads
https://sourceforge.net/projects/hplip/files/hplip/3.20.6/hplip-3.20.6.run/download?use_mirror=nchc
Open a terminal and remove the previously installed version:
sudo apt remove hplip*
Cd to the location where the installer was downloaded.
cd ~/Downloads
To install run this command:
sh hplip-3.20.6.run
Select the install mode Automatic, enter an a
Ensure the installer detected the correct Linux distribution.
Enter Your root/Superuser User Password.
The installer will now detect what dependencies your system will need to install before installing HPLIP
If your system is missing any dependencies they are now downloaded and installed.
./configure prepares HPLIP for install as well as your system is verified to have all the required dependencies for HPLIP.
'make' is then executed. Make compiles ("builds") HPLIP for your system.
'make install' is the actual install procedure, this step is where HPLIP is actually being installed to your system.
Use 'hp-setup' to configure your printer.
The first step is to select the printer connection type.
Next the setup tool will display printers detected.
Select the PPD file to be Used for Your printer, usually you will want to select the recommended PPD file.
Click "AddPrinter" to complete the printer setup process.
Solution 3:
From hplip's launchpad site I have found a solution which worked for me. It is post #7 in this thread. The problem I describe in the question is caused by Ubuntu 20.04 using python3 with reduced support for python2. If /usr/bin/python links to a python 2 version then running hplip-3.20.**.run will have the reported problems trying and failing to install the necessary python components.
To diagnose this problem, run
python --version
if you get a version with leading digit 2 then the fix is as follows
sudo unlink /usr/bin/python
sudo ln -s /usr/bin/python3.* /usr/bin/python
where python3.* is whichever version of python3 you have installed. You can find this out by running
ls /usr/bin/python*
Once I did this then running
sh hplip-3.20.**.run
worked fine