Fixing the password-problem
The problem is that the hplip-Installer incorrectly assumes an existing su-user, even though it has been deleted in favor of using sudo. This can be alleviated in the following way:
Download the hplip-*-.run-file for your distro from the hp-website from here.
Make the file executable, then run it. Now if you get the problem that this thread is about, abort the installation.
At this point, a folder has already been created at the directory where you ran the .run-file.
Inside this folder, there is a subfolder called base.
Inside this subfolder, there is a file called password.py
In this file, you will see a list named AUTH_TYPES, it contains key-value-pairs, where the key is a distro, and the value is the authentication-type. Locate your distribution, which, if you are having the ascribed problem, will likely have a 'su' as the value. Just change this value to 'sudo' and save the file.
Now restart the installation (run hplip-install in the created directory), and entering your password should now work as expected.
Cant install dependencies
This may not be the only problem though - the installer may also not be able to install the dependencies on your system. There are two possible solutions to this:
Either: Install dependencies manually (the installer prints out a list of dependencies, just install them manually)
Or: Change the code for dependency-installation in the installer as well:
- Open the file installer/distros.dat
- Locate your distribution in that file.
- Replace commands of the form
su -c "<command> by sudo <command>, also make sure to delete the closing-quotes. Laborious, yes, but with an editor with a good replace-tool, not too bad.
After you used one of the solutions above, go ahead and rerun the installer.
It will now either see your manually installed packages, or be able to install the dependencies itself based on the changes you made to the file mentioned above.
still getting unresolved dependencies
In my case the installer still claimed that pyqt5 and pyqt5-dbus would not be installed, even though I had them installed using pip. Maybe the installer would have needed the apt-packages, I am not really sure.
Anyway, if you are getting this problem as well, you can fix it by making changes to yet another file, namely installer/text_install.py.
In this file, search for conditions like if num_req_missing, then comment-out the related code-branches, to stop the installer from exiting when it finds missing packages.
Only do this if you are sure that all the dependencies are installed!!!
Start the installer again, and when it asks you if you want it to install the missing dependencies, enter n, and now it should finish.
Configuration-problem
After the installation, or when running hp-setup, you need to setup your printer. Here the password-problem hit once again, because after entering the correct credentials the program would tell me that they were wrong. Easy fix: run sudo hp-setup from your terminal, and you will be able to configure your printer.
remarks
This procedure was successfully used with the hplip-3.20.11 on a debian 10.7-system. I assume it should work on many other distros, but haven't tried. Other versions of the hplip may of course work a bit different, I hope not so different to render this answer unhelpful.