6

I am trying to connect to an HP M1217nfw MFP via Wi-Fi. The installation says I need an HP plugin for the printer.

hp-doctor notes that a required dependency pyqt5 is missing.

When I start hplip-3.20.3-plugin.run I get:

error: Unable to load Qt5 support. Is it installed? 
   Try running with -i or --qt3 instead.

When I run sudo ./hplip-3.20.3-plugin.run --qt3, it tells me there is an unrecognized flag.

If I try to install python-pyqt5 or python2-pyqt5 I get:

Unable to locate package

python3-pyqt5 is installed with the latest version

I have removed and reinstalled HPLIP both from the HP site using several versions from 3.18 to 3.20.9 and by reinstalling HPLIP 3.20 from the Ubuntu repository.

I checked that Python2 was installed with apt.

Trying to run hp-setup or hp-plugin dies with error:

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

Running lsb_release -a from the command line produces the correct release information.

It seems I need the HP Plugin and the HP Plugin downloader needs a generic pyqt5 module.

Any help would be greatly appreciated.


The suggested solutions involve running hp-setup or hp-plugin, but I can't as they error out on lsb_release -a.

I also can't run hplip-3.20.3-plugin.run as it errors out looking for pyqt5.

Output of dpkg -l hplip:

ii  hplip     3.20.3+dfsg0-2 amd64   HP Linux Printing and Imaging System (HPLIP)

Output of apt list python3-pyqt5:

python3-pyqt5/focal,now 5.14.1+dfsg-3build1 amd64 [installed]
python3-pyqt5/focal 5.14.1+dfsg-3build1 i386
Gord
  • 81

5 Answers5

5

Download a plugin from the OpenPrinting website. Install it with sh PLUGIN_FILENAME.

brian_p
  • 916
4

Based on the second best answer needs python3 to run by default for me running python3 $(which hp-plugin) fixes the problem and the dialog continues.

Wish i knew what is going on here though...

(ubuntu 20.04 with ColorLaserjet Pro MFP M281fdw here)

2

Thanks everyone for the suggestions. I finally solved this, Here is what I did. First as suggested I updated python to python 3 as described above. This fixed half the problem. Next I downloaded the hplip tarball from developers.hp.com/hp-linux-imaging-and-printing/gethplip

The problem is that in hplip/base/password.py they are still using platform.dist()[0] which was removed in python 3.8

So comment out hplip/base/password.py as follows:

`84 # try:

85 # os_name = platform.dist()[0]

86 # except AttributeError:

87 # import distro

88 # os_name = distro.linux_distribution()[0]

89`

or remove the code. Next go to https://www.openprinting.org/download/printdriver/auxfiles/HP/plugins/

download both the plugin.run and the plugin.run.asc files that match the version of hplip tarball you just downloaded.

Now follow the directions at developers.hp.com for installing the tarball.

Everything now works on my system.

Gord
  • 81
1

Edit: Realised I'm not using the plugin but the full on HP LIP installer. The problem I faced sounds the same though, so this might still help you

I faced the same problem over the last couple of days so tried to debug what the installer was doing (I'm using the latest, 3.20.11).

TL;DR: The installer is running python2 while I was installing pyqt5 for python3. I fixed it by running:

    $ sudo apt install python-is-python3

Once I knew that python2 was the issue, I found how to fix it here


For a bit more detail, by default /usr/bin/python is:

$ ls -l /usr/bin/python
lrwxrwxrwx 1 root root 7 Apr 15  2020 /usr/bin/python -> python2

When I tried to import PyQt5 in python2, it doesn't work:

$ python
Python 2.7.18 (default, Aug  4 2020, 11:16:42) 
[GCC 9.3.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import PyQt5
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named PyQt5

While in python3 it does:

$ python3
Python 3.8.5 (default, Jul 28 2020, 12:59:40) 
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import PyQt5
>>> 

After installing the package above, it updates the symlink to point to python3 and there are no more dependency errors:

$ ls -l /usr/bin/python
lrwxrwxrwx 1 root root 7 Apr 15  2020 /usr/bin/python -> python3
s8s
  • 11
0

I am writing this answer not to add much to what everything has added, but just to summarize what worked for me.

After upgrading to Ubuntu 20.04 hp-setup and hp-plugin were not working despite having the default Repo installed.

Then downloaded hplip-3.12.4.run from there https://developers.hp.com/hp-linux-imaging-and-printing/gethplip

Install sh hplip-3.12.4.run failed because of pyqt5. But the below made it work

sudo apt install python-is-python3
python3
>>> import PyQt5

But then hp-setup failed to install plugin with error

lsb_release -a

Then grabbed the plugin matching my hplip version here https://www.openprinting.org/download/printdriver/auxfiles/HP/plugins/ as stated by @bryan_p and installed the same way as hplip sh hplip-3.12.4.plugin.run and this time it installed properly.

hp-setup then ran smoothly

Maxence
  • 305
  • 1
  • 2
  • 12