hplip plugin installer fails 20.04LTS
After upgrading to 20.04LTS, my HP-LaserJet 1018 printer stopped printing. Looking at the logs, I found the following errors:
E [04/Apr/
E [04/Apr/
Strange. I tried completely purging and re-installing the hplip package and the problem still exists. So, I decided to try a more drastic approach: install the correct plugin outside of the package manager process.
I went here:
https:/
and downloaded:
hplip-3.
(I presume that the plugin version should match the dpkg version)
But when I try to run it, I get the following error:
$ sh hplip-3.
Verifying archive integrity... All good.
Uncompressing HPLIP 3.20.3 Plugin Self Extracting Archive.
Error setting home directory: /etc/hp/hplip.conf not found. Is HPLIP installed?
$
I googled around and tried all kinds of different things - I tried purging the hplip package and installing the binary installer dirctly from HP but that had problems with dependencies that I was unable to resolve easily so I gave up on that.
Not sure what to do next.
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- HPLIP Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- Manfred Hampl
- Solved:
- Last query:
- Last reply:
Related FAQ:
None Link to a FAQ
Revision history for this message
![]() |
#1 |
I suggest that you uninstall all versions of hplip and then install the version from the Ubuntu repositories (which is a modified version of 3.20.3 to cope with the dependency problems) and then install the plugin in the same version from the developers.hp.com web page.
Revision history for this message
![]() |
#2 |
Sorry if I didn't make that clear but I did that already. Nevertheless, I just repeated the whole thing again, capturing all output for the benefit of completeness:
First purge hplip:
$ sudo apt remove --purge 'hplip*'
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'hplip-data' for glob 'hplip*'
Note, selecting 'hplip' for glob 'hplip*'
Note, selecting 'hplip-doc' for glob 'hplip*'
Note, selecting 'hplip-gui' for glob 'hplip*'
Note, selecting 'hplip-cups' for glob 'hplip*'
Note, selecting 'hplip-ppds' for glob 'hplip*'
Package 'hplip-cups' is not installed, so not removed
Note, selecting 'hpijs-ppds' instead of 'hplip-ppds'
Package 'hplip' is not installed, so not removed
Package 'hplip-data' is not installed, so not removed
Package 'hplip-doc' is not installed, so not removed
Package 'hplip-gui' is not installed, so not removed
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
$ sudo apt autoremove
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
$ sudo rm -rf /usr/share/hplip
Now, make sure it really is gone:
$ ps -ef | grep hpl
usernam+ 57212 2837 0 09:57 pts/0 00:00:00 grep --color=auto hpl
$ find /bin -name "*hp*"
$ find /usr/bin -name "*hp*"
/usr/bin/
/usr/bin/arm2hpdl
/usr/bin/foo2hp
$ find /usr/local/bin -name "*hp*"
$ find /usr -name "*hpl*"
/usr/share/
/usr/share/
/usr/share/
/usr/share/
/usr/share/
/usr/share/
/usr/share/
/usr/share/
/usr/share/
/usr/share/
/usr/share/
/usr/share/
/usr/share/
/usr/lib/
/usr/lib/
/usr/lib/
/usr/lib/
/usr/lib/
/usr/lib/
/usr/lib/
/usr/lib/
/usr/lib/
/usr/lib/
Looks OK, now install again:
$ sudo apt update
Hit:1 http://
Hit:2 http://
Hit:3 http://
Hit:4 http://
Hit:5 http://
Reading package lists... Done
Building dependency tree
Reading state information... Done
All packages are up to date.
$ sudo apt install hplip
[sudo] password for username:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
hplip-data libhpmud0 libsane-hpaio printer-
Suggested packages:
hplip-doc hplip-gui
The following NEW packages will be installed:
hplip hplip-data libhpmud0 libsane-hpaio printer-
0 upgraded, 6 newly installed, 0 to remove and 0 not upgraded.
Need to get 8,252 kB of archives.
After this operation, 16.8 MB of additional disk space will be used.
Do you want to continue? [Y/n]
Get:1 http://
Get:2 http://
Get:3 http://
Get:4 http://
Get:5 http://
Get:6 http://
Fetched 8,252 kB in 1s (10.3 MB/s)
Selecting previously unselected package hplip-data.
(Reading database ... 303132 files and directories currently installed.)
Preparing to unpack .../0-hplip-
Unpacking hplip-data (3.20.3+dfsg0-2) ...
Selecting previously unselected package libhpmud0:amd64.
Preparing to unpack .../1-libhpmud0
Unpacking libhpmud0:amd64 (3.20.3+dfsg0-2) ...
Selecting previously unselected package libsane-
Preparing to unpack .../2-libsane-
Unpacking libsane-hpaio:amd64 (3.20.3+dfsg0-2) ...
Selecting previously unselected package printer-
Preparing to unpack .../3-printer-
Unpacking printer-
Selecting previously unselected package hplip.
Preparing to unpack .../4-hplip_
Unpacking hplip (3.20.3+dfsg0-2) ...
Selecting previously unselected package printer-
Preparing to unpack .../5-printer-
Unpacking printer-
Setting up hplip-data (3.20.3+dfsg0-2) ...
Setting up printer-
Setting up libhpmud0:amd64 (3.20.3+dfsg0-2) ...
Setting up libsane-hpaio:amd64 (3.20.3+dfsg0-2) ...
Setting up printer-
Setting up hplip (3.20.3+dfsg0-2) ...
Creating/updating hplip user account...
Can't open /etc/hp/hplip.conf: No such file or directory.
Can't open /etc/hp/hplip.conf: No such file or directory.
Processing triggers for libc-bin (2.31-0ubuntu9.2) ...
Processing triggers for man-db (2.9.1-1) ...
Processing triggers for dbus (1.12.16-
Processing triggers for cups (2.3.1-9ubuntu1.1) ...
Installation seems OK. Now install the plugin from a link obtained here: https:/
$ wget https:/
--2021-04-12 10:25:49-- https:/
Resolving developers.hp.com (developers.
Connecting to developers.hp.com (developers.
HTTP request sent, awaiting response... 200 OK
Length: 11514166 (11M)
Saving to: ‘hplip-
hplip-3.
2021-04-12 10:25:51 (9.01 MB/s) - ‘hplip-
$ sh hplip-3.
erifying archive integrity... All good.
Uncompressing HPLIP 3.20.3 Plugin Self Extracting Archive.
Error setting home directory: /etc/hp/hplip.conf not found. Is HPLIP installed?
$
Revision history for this message
![]() |
#3 |
Whoops! This URL "https:/
Revision history for this message
![]() |
#4 |
What is the output of the commands
find /etc -name "*hp*"
ls -l /etc/hp/
dpkg -L libsane-hpaio | grep conf
Revision history for this message
![]() |
#5 |
$ sudo find /etc -name "*hp*"
[sudo] password for username:
/etc/cron.d/php
/etc/dbus-
/etc/sane.
/etc/sane.
/etc/sane.d/hp.conf
/etc/sane.
/etc/sane.
/etc/sane.
/etc/systemd/
/etc/systemd/
/etc/apparmor.
/etc/apparmor.
/etc/php
/etc/php/
/etc/pam.d/chpasswd
/etc/hp
/etc/gufw/
$ ls -l /etc/hp/
total 0
$ dpkg -L libsane-hpaio | grep conf
/etc/hp/hplip.conf
$
Revision history for this message
![]() |
#6 |
What happen with the installation of the libsane-hpaio package? This package should have installed the /etc/hp/hplip.conf file, but it is not there!
What output do you receive for the commands
sudo apt install --reinstall libsane-hpaio
ls -l /etc/hp/
Revision history for this message
![]() |
#7 |
$ sudo apt install --reinstall libsane-hpaio
[sudo] password for username:
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 0 not upgraded.
Need to get 126 kB of archives.
After this operation, 0 B of additional disk space will be used.
Get:1 http://
Fetched 126 kB in 0s (477 kB/s)
(Reading database ... 303799 files and directories currently installed.)
Preparing to unpack .../libsane-
Unpacking libsane-hpaio:amd64 (3.20.3+dfsg0-2) over (3.20.3+dfsg0-2) ...
Setting up libsane-hpaio:amd64 (3.20.3+dfsg0-2) ...
$ ls -l /etc/hp/
total 0
$
Revision history for this message
![]() |
#8 |
This is unexpected. I have no clue why the file is not installed.
Is there anything in the system logs?
dmesg | tail
dmesg | grep hp
Revision history for this message
![]() |
#9 |
$ sudo dmesg | grep hp
[ 0.109506] clocksource: hpet: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 133484882848 ns
[ 0.142352] acpiphp: ACPI Hot Plug PCI Controller Driver version: 0.5
[ 0.170752] acpiphp: Slot [1] registered
[ 0.174847] hpet0: at MMIO 0xfed00000, IRQs 2, 8, 0, 0, 0, 0, 0, 0
[ 0.174847] hpet0: 8 comparators, 64-bit 14.318180 MHz counter
[ 0.364980] shpchp: Standard Hot Plug PCI Controller Driver version: 0.4
[ 0.411819] rtc_cmos 00:02: alarms up to one month, y3k, 242 bytes nvram, hpet irqs
[ 1.954530] psmouse serio2: synaptics: Your touchpad (PNP: SYN1212 PNP0f13) says it can support a different bus. If i2c-hid and hid-rmi are not used, you might want to try setting psmouse.
[ 2.101933] psmouse serio2: synaptics: Touchpad model: 1, fw: 8.1, id: 0x1e2b1, caps: 0xd00123/
[ 6.086528] snd_hda_codec_via hdaudioC1D0: hp_outs=1 (0x25/0x0/
$ sudo dmesg | tail -n 700 | grep -v 'wlp4s0' | grep -v iwlwifi| grep -v usb
[ 6.243805] ieee80211 phy0: Selected rate control algorithm 'iwl-mvm-rs'
[ 6.296527] loop16: detected capacity change from 0 to 104536
[ 6.355070] loop17: detected capacity change from 0 to 131792
[ 11.556911] EXT4-fs (sda1): mounted filesystem with ordered data mode. Opts: (null). Quota mode: none.
[ 11.569556] Adding 4194300k swap on /dev/sda2. Priority:-2 extents:1 across:4194300k SSFS
[ 11.588008] audit: type=1400 audit(161815667
[ 11.590199] audit: type=1400 audit(161815667
[ 11.590205] audit: type=1400 audit(161815667
[ 11.590208] audit: type=1400 audit(161815667
[ 11.590496] audit: type=1400 audit(161815667
[ 11.590501] audit: type=1400 audit(161815667
[ 11.592741] audit: type=1400 audit(161815667
[ 11.592749] audit: type=1400 audit(161815667
[ 11.594591] audit: type=1400 audit(161815667
[ 12.091703] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[ 12.091707] Bluetooth: BNEP filters: protocol multicast
[ 12.091711] Bluetooth: BNEP socket layer initialized
[ 12.101767] NET: Registered protocol family 38
[ 12.653787] bridge: filtering via arp/ip/ip6tables is no longer available by default. Update your scripts to load br_netfilter if you need this.
[ 12.654547] virbr0: port 1(virbr0-nic) entered blocking state
[ 12.654550] virbr0: port 1(virbr0-nic) entered disabled state
[ 12.654585] device virbr0-nic entered promiscuous mode
[ 12.677683] RTL8211E Gigabit Ethernet r8169-502:00: attached PHY driver (mii_bus:
[ 12.684646] bpfilter: Loaded bpfilter_umh pid 1294
[ 12.684869] Started bpfilter
[ 12.757980] loop18: detected capacity change from 0 to 8
[ 12.897333] r8169 0000:05:00.2 enp5s0f2: Link is Down
[ 14.338158] virbr0: port 1(virbr0-nic) entered blocking state
[ 14.338166] virbr0: port 1(virbr0-nic) entered listening state
[ 14.378319] virbr0: port 1(virbr0-nic) entered disabled state
[ 14.469663] L1TF CPU bug present and SMT on, data leak possible. See CVE-2018-3646 and https:/
[ 15.643026] r8169 0000:05:00.2 enp5s0f2: Link is Up - 1Gbps/Full - flow control rx/tx
[ 15.643059] IPv6: ADDRCONF(
[ 19.596738] rfkill: input handler disabled
[ 68.418033] Bluetooth: RFCOMM TTY layer initialized
[ 68.418040] Bluetooth: RFCOMM socket layer initialized
[ 68.418044] Bluetooth: RFCOMM ver 1.11
[ 68.585006] rfkill: input handler enabled
[ 71.544241] rfkill: input handler disabled
[ 71.673340] r8169 0000:05:00.2 enp5s0f2: Link is Down
[ 101.659726] PM: suspend entry (deep)
[ 101.669410] Filesystems sync: 0.009 seconds
[ 101.787043] Freezing user space processes ... (elapsed 0.003 seconds) done.
[ 101.790418] OOM killer disabled.
[ 101.790420] Freezing remaining freezable tasks ... (elapsed 0.001 seconds) done.
[ 101.791762] printk: Suspending console(s) (use no_console_suspend to debug)
[ 101.809074] sd 4:0:0:0: [sda] Synchronizing SCSI cache
[ 101.810234] sd 4:0:0:0: [sda] Stopping disk
[ 103.741756] ACPI: EC: interrupt blocked
[ 103.761838] ACPI: Preparing to enter system sleep state S3
[ 103.763809] ACPI: EC: event blocked
[ 103.763811] ACPI: EC: EC stopped
[ 103.763812] PM: Saving platform NVS memory
[ 103.763834] Disabling non-boot CPUs ...
[ 103.765638] smpboot: CPU 1 is now offline
[ 103.768592] smpboot: CPU 2 is now offline
[ 103.771379] smpboot: CPU 3 is now offline
[ 103.773286] IRQ 31: no longer affine to CPU4
[ 103.774312] smpboot: CPU 4 is now offline
[ 103.776710] IRQ 34: no longer affine to CPU5
[ 103.777743] smpboot: CPU 5 is now offline
[ 103.779274] IRQ 18: no longer affine to CPU6
[ 103.779291] IRQ 36: no longer affine to CPU6
[ 103.780305] smpboot: CPU 6 is now offline
[ 103.781900] IRQ 16: no longer affine to CPU7
[ 103.781921] IRQ 38: no longer affine to CPU7
[ 103.782939] smpboot: CPU 7 is now offline
[ 103.785240] ACPI: Low-level resume complete
[ 103.785286] ACPI: EC: EC started
[ 103.785287] PM: Restoring platform NVS memory
[ 103.787989] Enabling non-boot CPUs ...
[ 103.788039] x86: Booting SMP configuration:
[ 103.788040] smpboot: Booting Node 0 Processor 1 APIC 0x2
[ 103.790260] CPU1 is up
[ 103.790292] smpboot: Booting Node 0 Processor 2 APIC 0x4
[ 103.792541] CPU2 is up
[ 103.792574] smpboot: Booting Node 0 Processor 3 APIC 0x6
[ 103.794813] CPU3 is up
[ 103.794845] smpboot: Booting Node 0 Processor 4 APIC 0x1
[ 103.795612] CPU4 is up
[ 103.795641] smpboot: Booting Node 0 Processor 5 APIC 0x3
[ 103.796285] CPU5 is up
[ 103.796308] smpboot: Booting Node 0 Processor 6 APIC 0x5
[ 103.796964] CPU6 is up
[ 103.796987] smpboot: Booting Node 0 Processor 7 APIC 0x7
[ 103.797667] CPU7 is up
[ 103.800551] ACPI: Waking up from system sleep state S3
[ 103.801881] ACPI: EC: interrupt unblocked
[ 103.823428] ACPI: EC: event unblocked
[ 103.824287] sd 4:0:0:0: [sda] Starting disk
[ 103.902508] xhci_hcd 0000:00:14.0: Port resume timed out, port 3-2: 0x400a03
[ 104.148851] ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
[ 104.177019] ata3: SATA link down (SStatus 0 SControl 300)
[ 104.177122] ata5: SATA link up 6.0 Gbps (SStatus 133 SControl 300)
[ 104.185202] ata5.00: ACPI cmd ef/10:06:
[ 104.185217] ata5.00: ACPI cmd f5/00:00:
[ 104.185219] ata5.00: ACPI cmd b1/c1:00:
[ 104.185456] ata5.00: supports DRM functions and may not be fully accessible
[ 104.185890] ata5.00: NCQ Send/Recv Log not supported
[ 104.186818] ata5.00: ACPI cmd ef/10:06:
[ 104.186823] ata5.00: ACPI cmd f5/00:00:
[ 104.186836] ata5.00: ACPI cmd b1/c1:00:
[ 104.187026] ata5.00: supports DRM functions and may not be fully accessible
[ 104.187455] ata5.00: NCQ Send/Recv Log not supported
[ 104.188085] ata5.00: configured for UDMA/133
[ 104.192377] ata1.00: configured for UDMA/100
[ 104.770315] OOM killer enabled.
[ 104.770317] Restarting tasks ... done.
[ 104.777024] PM: suspend exit
[ 104.960199] psmouse serio2: synaptics: queried max coordinates: x [..5672], y [..4722]
[ 105.119539] psmouse serio2: synaptics: queried min coordinates: x [1380..], y [1192..]
[ 105.343536] Bluetooth: hci0: read Intel version: 370710018002030d00
[ 105.346931] Bluetooth: hci0: Intel Bluetooth firmware file: intel/ibt-
[ 105.548595] Bluetooth: hci0: unexpected event for opcode 0xfc2f
[ 105.565685] Bluetooth: hci0: Intel BT fw patch 0x57 completed & activated
[ 106.015277] RTL8211E Gigabit Ethernet r8169-502:00: attached PHY driver (mii_bus:
[ 106.228703] r8169 0000:05:00.2 enp5s0f2: Link is Down
[ 109.015553] r8169 0000:05:00.2 enp5s0f2: Link is Up - 1Gbps/Full - flow control rx/tx
[ 109.015588] IPv6: ADDRCONF(
[39713.651995] kauditd_printk_skb: 41 callbacks suppressed
[39713.651998] audit: type=1400 audit(161819642
[85101.726103] audit: type=1400 audit(161824180
[85101.726135] audit: type=1400 audit(161824180
[85147.248028] audit: type=1400 audit(161824185
[85147.248036] audit: type=1400 audit(161824185
[85147.248040] audit: type=1400 audit(161824185
[85147.248076] audit: type=1400 audit(161824185
[85147.248080] audit: type=1400 audit(161824185
[85370.993272] audit: type=1400 audit(161824207
[85370.993668] audit: type=1400 audit(161824207
[85406.074858] audit: type=1400 audit(161824211
[85406.074995] audit: type=1400 audit(161824211
Revision history for this message
![]() |
#10 |
Bump:
So, the big question is, is there something I can do to fix this or do I need to file a bug?
Revision history for this message
![]() |
#11 |
The only workaround I can suggest is manually extracting the missing file from the deb package and putting it where it belongs.
If you create a bug report, then you most probably should file it against "hplip in Ubuntu", because the problem seems to be only in the package for Ubuntu and not in the original HPLIP software.
Revision history for this message
![]() |
#13 |
How do I go about "manually extracting the missing file from the deb package and putting it where it belongs"?
I noticed that, when I enter dpkg -s hplip, the output includes the lines
...
Conffiles:
/etc/dbus-
I'm not sure what the long number is at the end but I wonder if I can just make a symbolic link to that file?
$ sudo ln /etc/dbus-
Does it matter if it is a symbolic or hard link?
Revision history for this message
![]() |
#14 |
No, unfortunately, other errors occur suggesting that "/etc/dbus-
$ sudo ln /etc/dbus-
[sudo] password for username:
$ sh hplip-3.
Verifying archive integrity... All good.
Uncompressing HPLIP 3.20.3 Plugin Self Extracting Archive.
Traceback (most recent call last):
File "./plugin_
config.
File "/usr/lib/
self._read(fp, filename)
File "/usr/lib/
raise MissingSectionH
ConfigParser.
file: /etc/hp/hplip.conf, line: 1
'<?xml version="1.0" encoding="UTF-8"?> <!-- -*- XML -*- -->\n'
$
The output of dpkg -L hplip doesn't show any other files for the /etc directory. Any ideas before I give up this question and wait for any response from the bug report?
Revision history for this message
![]() |
#15 |
There is a "dpkg-deb --extract" command that allows extracting the files from a deb package into a directory.
This should allow unpacking the contents of the deb archive into a temporary directory and then copying the conf file to the right location. Carefully read the manpages how to use it before trying this.
Revision history for this message
![]() |
#16 |
@Manfred:
As I said already, the conf file listed in the output of dpkg -L hplip do not show any file named "/etc/hp/
$ dpkg -L hplip
/.
/etc
/etc/dbus-1
/etc/dbus-
/etc/dbus-
/usr
/usr/bin
... etc
Also:
$ apt download hplip
$ dpkg-deb -c hplip_3.
drwxr-xr-x root/root 0 2020-04-01 03:51 ./
drwxr-xr-x root/root 0 2020-04-01 03:51 ./etc/
drwxr-xr-x root/root 0 2020-04-01 03:51 ./etc/dbus-1/
drwxr-xr-x root/root 0 2020-04-01 03:51 ./etc/dbus-
-rw-r--r-- root/root 752 2020-04-01 03:51 ./etc/dbus-
drwxr-xr-x root/root 0 2020-04-01 03:51 ./usr/
drwxr-xr-x root/root 0 2020-04-01 03:51 ./usr/bin/
... etc
$ dpkg-deb --extract hplip_3.
$ tree hplip_3.
hplip_3.
└── dbus-1
└── system.d
└── com.hp.hplip.conf
2 directories, 1 file
$
So, which file in this list am I supposed to copy to /etc/hp/hplip.conf?
$ sudo cp hplip_3.
[sudo] password for username:
$ sh hplip-3.
Verifying archive integrity... All good.
Uncompressing HPLIP 3.20.3 Plugin Self Extracting Archive.
Traceback (most recent call last):
File "./plugin_
config.
File "/usr/lib/
self._read(fp, filename)
File "/usr/lib/
raise MissingSectionH
ConfigParser.
file: /etc/hp/hplip.conf, line: 1
'<?xml version="1.0" encoding="UTF-8"?> <!-- -*- XML -*- -->\n'
Same error as I got in comment #14!
I am making the incorrect assumption that /etc/dbus-
is the same as /etc/hp/hplip.conf, which clearly is incorrect.
There is no /etc/hp/hplip.conf in the package at all!
Revision history for this message
![]() |
#17 |
Sorry, my fault, I was not clear enough.
From comment #5:
$ dpkg -L libsane-hpaio | grep conf
/etc/hp/hplip.conf
The file /etc/hp/hplip.conf is in the package libsane-hpaio, i.e. in libsane-
Revision history for this message
![]() |
#18 |
$ sudo cp libsane-
Verifying archive integrity... All good.
Uncompressing HPLIP 3.20.3 Plugin Self Extracting Archive.
Error importing HPLIP modules. Is HPLIP installed?
$
So, now what? Let's dig in! It turns out there's a help option:
$ sh hplip-3.
Makeself version 2.1.5
1) Getting help or info about hplip-3.
hplip-
hplip-
hplip-
hplip-
hplip-
2) Running hplip-3.
hplip-
with following options (in that order)
--confirm Ask before running embedded script
--noexec Do not run embedded script
--keep Do not erase target directory after running
the embedded script
--nox11 Do not spawn an xterm
--nochown Do not give the extracted files to the current user
--target NewDirectory Extract in NewDirectory
--tar arg1 [arg2 ...] Access the contents of the archive through the tar command
-- Following arguments will be passed to the embedded script
It looks like I can extract the plugin and see what can be done there:
$ sh hplip-3.
$ cd testplugin
$ ./hplip-
Error importing HPLIP modules. Is HPLIP installed?
$ cd ..
$
So it seems that the bash script invokes plugin_install.py
The script is failing with an exception in a try block that is importing several
modules but which one is it? I broke up the try block into a number of blocks,
one for each import operation:
$ diff plugin-
21a22
> print ("Running ", __file__)
95a97,103
> #try:
> # from base.g import *
> # from base.codes import *
> # from base import utils, tui, module
> #except ImportError:
> # print("Error importing HPLIP modules. Is HPLIP installed?")
> # sys.exit(1)
98a107,111
> except ImportError:
> print("Error importing base.g")
> sys.exit(1)
>
> try:
100d112
< from base import utils, tui, module
102c114,133
< print("Error importing HPLIP modules. Is HPLIP installed?")
---
> print("Error importing base.codes")
> sys.exit(1)
>
> try:
> from base import utils
> except ImportError:
> print("Error importing utils")
> sys.exit(1)
>
> try:
> from base import tui
> except ImportError:
> print("Error importing tui")
> sys.exit(1)
>
> try:
> from base import module
> except ImportError as error:
> print("Error importing module")
> print(error.
$ cd testplugin/
$ ./hplip-
('Running ', './plugin_
Error importing module
ImportError: No module named cupsext
$
So what is "cupsext"?
After googling the error, I came across this web page:
which states:
ImportError:No Module named 'cupsext'
Notes:
Extension modules are missing from the current Python path "/usr/lib/
This happens when HPLIP is installed using one python version and you are running HPLIP using another python version.
For example, HPLIP was installed using python2.x and running the tools using python3.x
Please ensure to run HPLIP tools using the same version of Python which was used for HPLIP installation or re-install HPLIP from https:/
My question is this: What do they mean by "HPLIP was installed using python2.x and running the tools using python3.x"?
How was I supposed to know this in advance?
$ python -V
Python 2.7.18
$
So how do I find out which python is supposed to be running? How do I make the correct version of python run?
How do I install hplip with the correct version of python? Ditto for the plugin.
$ apt-cache depends hplip | grep python
Depends: python3-dbus
Depends: python3-gi
Depends: python3-pexpect
Depends: python3-pil
Depends: python3-reportlab
Depends: <python3:any>
python3:i386
python3
Depends: python3
Depends: python3
Depends: libpython3.8
Suggests: python3-notify2
$ dpkg -s python3
Package: python3
Status: install ok installed
Priority: important
Section: python
Installed-Size: 189
Maintainer: Ubuntu Developers <email address hidden>
Architecture: amd64
Multi-Arch: allowed
Source: python3-defaults
Version: 3.8.2-0ubuntu2
Replaces: python3-minimal (<< 3.1.2-2)
Provides: python3-profiler
Depends: python3.8 (>= 3.8.2-1~), libpython3-stdlib (= 3.8.2-0ubuntu2)
Pre-Depends: python3-minimal (= 3.8.2-0ubuntu2)
Suggests: python3-doc (>= 3.8.2-0ubuntu2), python3-tk (>= 3.8.2-1~), python3-venv (>= 3.8.2-0ubuntu2)
Description: interactive high-level object-oriented language (default python3 version)
Python, the high-level, interactive object oriented language,
includes an extensive class library with lots of goodies for
network programming, system administration, sounds and graphics.
.
This package is a dependency package, which depends on Debian's default
Python 3 version (currently v3.8).
Homepage: https:/
Original-
$
Revision history for this message
![]() |
#19 |
$ ls /usr/lib/
cupsext.
Revision history for this message
![]() |
#20 |
Can I do something like this?
$ sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 1
If I do this do I have to re-install hplip?
Revision history for this message
![]() |
#21 |
Let's see:
$ sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 1
[sudo] password for username:
update-
$ sh hplip-3.
Verifying archive integrity... All good.
Uncompressing HPLIP 3.20.3 Plugin Self Extracting Archive.
HP Linux Imaging and Printing System (ver. 3.20.3)
Plugin Installer ver. 3.0
Copyright (c) 2001-18 HP Development Company, LP
This software comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to distribute it
under certain conditions. See COPYING file for more details.
Plug-in version: 3.20.3
Installed HPLIP version: 3.20.3
Number of files to install: 64
note: Using PyQt5
Done.
$
THAT'S IT!!!
I just printed a test page and a libre-office document!
Revision history for this message
![]() |
#22 |
Thanks Manfred Hampl, that solved my question.
Revision history for this message
![]() |
#23 |
Congratulations for solving the puzzle!