Siduction Forum

Siduction Forum => Upgrade Warnings => Topic started by: dibl on 2025/01/18, 13:46:30

Title: Python 3 upgrade forces removal of hplip & friends
Post by: dibl on 2025/01/18, 13:46:30
For some days now the apt --solver 3.0 has allowed me to leave libreoffice and some others un-upgraded, so I could keep hplip, hplip-gui, and hplip-data. This morning, the upgrade to python3 (3.13.1-2) will force removal of hplip. I'm sure this situation will be fixed, but I'm not sure when that day will come, and my only printer is an HP Laserjet.

Be careful, friends!   :-\
Title: Re: Python 3 upgrade forces removal of hplip & friends
Post by: eriefisher on 2025/01/18, 14:44:08
It was actually a mismatch between python parts. It also wanted to remove some uno stuff thus the issue with libreoffice. It may have been pythonenv, I forget.
Title: Re: Python 3 upgrade forces removal of hplip & friends
Post by: dibl on 2025/01/18, 18:11:06
Being sid, I don't want to let my main productivity system to go very many days with no upgrade. Happily, I have a Win10 VM that makes a dandy printer driver, when necessary. 
Title: Re: Python 3 upgrade forces removal of hplip & friends
Post by: eriefisher on 2025/01/18, 18:16:33
I'm not sure about your printer but many will run driverless these days.
Title: Re: Python 3 upgrade forces removal of hplip & friends
Post by: dibl on 2025/01/18, 18:53:47
It's an antique LOL -- LaserJet p1606dn. But it's been a good printer for a long time, and works flawlessly.
Title: Re: Python 3 upgrade forces removal of hplip & friends
Post by: GoinEasy9 on 2025/01/19, 14:11:33
Thanks Dibl, this is why I always check the upgrade warnings before doing an update.

Tom
Title: Re: Python 3 upgrade forces removal of hplip & friends
Post by: tranquil on 2025/01/19, 19:52:49
Quote from: dibl on 2025/01/18, 18:11:06
Being sid, I don't want to let my main productivity system to go very many days with no upgrade. Happily, I have a Win10 VM that makes a dandy printer driver, when necessary.

I ran apt upgrade today and that doesn't want to remove hplip.
Title: Re: Python 3 upgrade forces removal of hplip & friends
Post by: dibl on 2025/01/19, 20:03:23
Quote from: tranquil on 2025/01/19, 19:52:49
I ran apt upgrade today and that doesn't want to remove hplip.

I see that  -- I can confirm. Thanks for the good news!
Title: Re: Python 3 upgrade forces removal of hplip & friends
Post by: seasons on 2025/01/21, 16:06:10
I uninstalled it and now I can't reinstall it. https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1093486
The hplip package needs a new version (3.24.4) anyway: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1076032

It looks like the maintainer has been "out to lunch" for a while.
Title: Re: Python 3 upgrade forces removal of hplip & friends
Post by: dibl on 2025/01/21, 19:14:27
Aha -- thanks for this update, confirming what I've seen here. I didn't upgrade again today, when I saw that hplip was to be removed. So I'm still printing .....

However, as said by Giacomo Mulas in his bug report:

QuoteOf course, stalling the transition will, on the long run, end in dependency hell, hence the "important" tag.
Title: Re: Python 3 upgrade forces removal of hplip & friends
Post by: Teriarch on 2025/01/21, 22:17:48
In the meantime you may replace the shebangs
#!/usr/bin/python3
wherever they occur in the hplip and hplip-data packages by
#!/usr/bin/python3.12.

I modified the respective packages accordingly, so if someone
is interested, let me know and I can send you a download link.
Title: Re: Python 3 upgrade forces removal of hplip & friends
Post by: dibl on 2025/01/22, 21:57:38
@Teriarch, thanks for doing that.

Yes, I'd like to try your fixed packages. You can provide the link in a message to me on this forum.
Title: Re: Python 3 upgrade forces removal of hplip & friends
Post by: Teriarch on 2025/01/22, 23:31:06
@dibl

I'm glad someone is willing to test it. I didn't find any issues, but you never know...

You have to install python3.12 though (if not already done so). hplip is restricted
to python 3.12 and when sid went to 3.13 they changed the symbolic link python3
from python3.12 to python3.13. Since hplip uses #!/usr/bin/python3 to mean python3.12
in their python executables, the system would break after the move. To prevent this from happening
they included a  python3 (<< 3.13) dependency in the hplip package. This caused the remove
after the upgrade. So I adapted the headers to #!/usr/bin/python3.12, corrected the dependency
to python3 (<< 3.14) and updated hplip's  version from 3.22.10+dfsg0-5.1 to 3.22.10+dfsg0-5.1b
(in order to account for subsequent official upgrades).

Please be aware that this is not an official version, but rather a proof of concept. For copyright
reasons and since I am not the author of hplip I would rather abstain from making the link public.
Can you provide me with an e-mail address where I can send the link to? If you consider the changes
useful we may contact the original authors and ask for permission.
Title: Re: Python 3 upgrade forces removal of hplip & friends
Post by: dibl on 2025/01/23, 15:51:19
OK, my target system is fully updated and has python3.13.1-2 installed. I see that python3.12.8-1 is available in the testing repo. Do I understand from your post that I need to use apt to remove "python3", then with the testing repo enabled, install "python3=3.12.8-1"?

I simulated removal of python3, and it is quite an impressive screen full of removed packages. I wonder -- is this at least semi-safe to do?

Thanks!
Title: Re: Python 3 upgrade forces removal of hplip & friends
Post by: Teriarch on 2025/01/23, 16:12:16
You should be able to install python3.12 w/o any removal. Both versions coexist just fine:

$ dpkg -l|grep python3.12
ii  idle-python3.12                                          3.12.8-5                                 all          IDE for Python (v3.12) using Tkinter
ii  libpython3.12-dev:amd64                                  3.12.8-5                                 amd64        Header files and a static library for Python (v3.12)
ii  libpython3.12-minimal:amd64                              3.12.8-5                                 amd64        Minimal subset of the Python language (version 3.12)
ii  libpython3.12-stdlib:amd64                               3.12.8-5                                 amd64        Interactive high-level object-oriented language (standard library, version 3.12)
ii  libpython3.12-testsuite                                  3.12.8-5                                 all          Testsuite for the Python standard library (v3.12)
ii  libpython3.12t64:amd64                                   3.12.8-5                                 amd64        Shared Python runtime library (version 3.12)
ii  python3.12                                               3.12.8-5                                 amd64        Interactive high-level object-oriented language (version 3.12)
ii  python3.12-dev                                           3.12.8-5                                 amd64        Header files and a static library for Python (v3.12)
ii  python3.12-full                                          3.12.8-5                                 amd64        Python Interpreter with complete class library (version 3.12)
ii  python3.12-gdbm                                          3.12.8-5                                 amd64        GNU dbm database support for Python (v3.12)
ii  python3.12-minimal                                       3.12.8-5                                 amd64        Minimal subset of the Python language (version 3.12)
ii  python3.12-tk                                            3.12.8-5                                 amd64        Tkinter - Writing Tk applications with Python (v3.12)
ii  python3.12-venv                                          3.12.8-5                                 amd64        Interactive high-level object-oriented language (pyvenv binary, version 3.12)

$ dpkg -l|grep python3.13
ii  idle-python3.13                                          3.13.1-3                                 all          IDE for Python (v3.13) using Tkinter
ii  libpython3.13:amd64                                      3.13.1-3                                 amd64        Shared Python runtime library (version 3.13)
ii  libpython3.13-dev:amd64                                  3.13.1-3                                 amd64        Header files and a static library for Python (v3.13)
ii  libpython3.13-minimal:amd64                              3.13.1-3                                 amd64        Minimal subset of the Python language (version 3.13)
ii  libpython3.13-stdlib:amd64                               3.13.1-3                                 amd64        Interactive high-level object-oriented language (standard library, version 3.13)
ii  libpython3.13-testsuite                                  3.13.1-3                                 all          Testsuite for the Python standard library (v3.13)
ii  python3.13                                               3.13.1-3                                 amd64        Interactive high-level object-oriented language (version 3.13)
ii  python3.13-dev                                           3.13.1-3                                 amd64        Header files and a static library for Python (v3.13)
ii  python3.13-full                                          3.13.1-3                                 amd64        Python Interpreter with complete class library (version 3.13)
ii  python3.13-gdbm                                          3.13.1-3                                 amd64        GNU dbm database support for Python (v3.13)
ii  python3.13-minimal                                       3.13.1-3                                 amd64        Minimal subset of the Python language (version 3.13)
ii  python3.13-tk                                            3.13.1-3                                 amd64        Tkinter - Writing Tk applications with Python (v3.13)
ii  python3.13-venv                                          3.13.1-3                                 amd64        Interactive high-level object-oriented language (pyvenv binary, version 3.13)

Can you post the output of
$ sudo apt-get -s install python3.12
Title: Re: Python 3 upgrade forces removal of hplip & friends
Post by: dibl on 2025/01/23, 16:42:21
OK, well -- I guess I can be embarrassed now ...

don@Hibiscus:~$ sudo apt -s install python3.12

python3.12 is already the newest version (3.12.8-5).
python3.12 set to manually installed.
Summary:
  Upgrading: 0, Installing: 0, Removing: 0, Not Upgrading: 0


OK. Learned something.   ::)

Title: Re: Python 3 upgrade forces removal of hplip & friends
Post by: dibl on 2025/01/23, 16:45:46
Should the python3-pil issue be fixed before installing the hplip packages?
Title: Re: Python 3 upgrade forces removal of hplip & friends
Post by: dibl on 2025/01/23, 17:03:18
OK, the 2 python3-pil packages are installed, and hplip-data is installed. There is a remaining issue blocking the hplip package. 

$ sudo dpkg -i hplip_3.22.10+dfsg0-5.1b_amd64.deb
(Reading database ... 309613 files and directories currently installed.)
Preparing to unpack hplip_3.22.10+dfsg0-5.1b_amd64.deb ...
Unpacking hplip (3.22.10+dfsg0-5.1b) over (3.22.10+dfsg0-5.1b) ...
dpkg: dependency problems prevent configuration of hplip:
hplip depends on libsane-hpaio (= 3.22.10+dfsg0-5.1); however:
  Package libsane-hpaio is not installed.
hplip depends on printer-driver-hpcups (= 3.22.10+dfsg0-5.1); however:
  Package printer-driver-hpcups is not installed.
hplip depends on python3-reportlab; however:
  Package python3-reportlab is not installed.

dpkg: error processing package hplip (--install):
dependency problems - leaving unconfigured
Processing triggers for dbus (1.16.0-1) ...
Processing triggers for man-db (2.13.0-1) ...
Errors were encountered while processing:
hplip


Ideas?
Title: Re: Python 3 upgrade forces removal of hplip & friends
Post by: Teriarch on 2025/01/23, 17:17:36
> Ideas?

Why not install it?

$ sudo apt-get -s install libsane-hpaio printer-driver-hpcups python3-reportlab

(option "-s" just for dry-run, if no problems reported, skip it)

And yes the python3-pil issue is resolved by now.
Title: Re: Python 3 upgrade forces removal of hplip & friends
Post by: Teriarch on 2025/01/23, 17:25:07
... and just in case the apt-get fails for some reason, try:

$ sudo apt --fix-broken install

and look for possible removals before you proceed.
Title: Re: Python 3 upgrade forces removal of hplip & friends
Post by: dibl on 2025/01/23, 18:09:32
Got it.

$ sudo apt policy hplip hplip-data
hplip:
  Installed: 3.22.10+dfsg0-5.1b
  Candidate: 3.22.10+dfsg0-5.1b
  Version table:
*** 3.22.10+dfsg0-5.1b 100
        100 /var/lib/dpkg/status
     3.22.10+dfsg0-5.1 500
        500 https://deb.debian.org/debian unstable/main amd64 Packages
hplip-data:
  Installed: 3.22.10+dfsg0-5.1b
  Candidate: 3.22.10+dfsg0-5.1b
  Version table:
*** 3.22.10+dfsg0-5.1b 100
        100 /var/lib/dpkg/status
     3.22.10+dfsg0-5.1 500
        500 https://deb.debian.org/debian unstable/main amd64 Packages


I guess I need to go through the hp-check process next.
Title: Re: Python 3 upgrade forces removal of hplip & friends
Post by: dibl on 2025/01/23, 18:19:16
OK, LaserJet Pro p1606dn is installed, and I am looking at a perfect printer test page.

SUCCESS!

Thank you, @Teriarch -- very nice bit of work!

Here is the hardware, in case it is relevant:

System:
  Kernel: 6.12.10-1-siduction-amd64 arch: x86_64 bits: 64
  Desktop: KDE Plasma v: 6.2.5 Distro: siduction 22.1.2 Masters_of_War -
    kde - (202303151559)
Machine:
  Type: Desktop System: ASUS product: All Series v: N/A
    serial: <superuser required>
  Mobo: ASUSTeK model: Z87-WS v: Rev 1.xx serial: <superuser required>
    UEFI: American Megatrends v: 2004 date: 06/05/2014
CPU:
  Info: quad core model: Intel Core i7-4770 bits: 64 type: MT MCP cache:
    L2: 1024 KiB
  Speed (MHz): avg: 800 min/max: 800/3900 cores: 1: 800 2: 800 3: 800 4: 800
    5: 800 6: 800 7: 800 8: 800
Graphics:
  Device-1: NVIDIA GM107 [GeForce GTX 750 Ti] driver: nvidia v: 550.142
  Display: wayland server: X.org v: 1.21.1.15 with: Xwayland v: 24.1.4
    compositor: kwin_wayland driver: X: loaded: nvidia
    unloaded: fbdev,modesetting,nouveau,vesa gpu: nvidia,nvidia-nvswitch
    resolution: 1366x768~60Hz
  API: EGL v: 1.5 drivers: nvidia,swrast
    platforms: gbm,wayland,x11,surfaceless,device
  API: OpenGL v: 4.6.0 compat-v: 4.5 vendor: nvidia v: 550.142
    renderer: NVIDIA GeForce GTX 750 Ti/PCIe/SSE2
  API: Vulkan v: 1.4.304 drivers: N/A surfaces: xcb,xlib,wayland
  Info: Tools: api: clinfo, eglinfo, glxinfo, vulkaninfo
    de: kscreen-console,kscreen-doctor gpu: nvidia-settings,nvidia-smi
    wl: wayland-info x11: xdriinfo, xdpyinfo, xprop, xrandr
Audio:
  Device-1: Intel 8 Series/C220 Series High Definition Audio
    driver: snd_hda_intel
  Device-2: NVIDIA GM107 High Definition Audio [GeForce 940MX]
    driver: snd_hda_intel
  API: ALSA v: k6.12.10-1-siduction-amd64 status: kernel-api
  Server-1: PipeWire v: 1.2.7 status: active
Network:
  Device-1: Intel I210 Gigabit Network driver: igb
  IF: enp6s0 state: up speed: 1000 Mbps duplex: full mac: <filter>
  Device-2: Intel I210 Gigabit Network driver: igb
  IF: enp9s0 state: down mac: <filter>
  IF-ID-1: br0 state: up speed: 1000 Mbps duplex: unknown mac: <filter>
Drives:
  Local Storage: total: 2.27 TiB used: 776.4 GiB (33.3%)
  ID-1: /dev/sda vendor: Samsung model: SSD 850 EVO 500GB size: 465.76 GiB
  ID-2: /dev/sdb vendor: Western Digital model: WD1000DHTZ-04N21V0
    size: 931.51 GiB
  ID-3: /dev/sdc vendor: Western Digital model: WD1000DHTZ-04N21V0
    size: 931.51 GiB
Partition:
  ID-1: / size: 58.72 GiB used: 13.63 GiB (23.2%) fs: ext4 dev: /dev/sda4
  ID-2: /boot size: 537.9 MiB used: 119.3 MiB (22.2%) fs: ext2
    dev: /dev/sda3
  ID-3: /boot/efi size: 511 MiB used: 152 KiB (0.0%) fs: vfat dev: /dev/sda1
  ID-4: /home size: 388.89 GiB used: 155.14 GiB (39.9%) fs: ext4
    dev: /dev/sda5
Swap:
  ID-1: swap-1 type: partition size: 8 GiB used: 0 KiB (0.0%) dev: /dev/sda2
Sensors:
  System Temperatures: cpu: 28.0 C mobo: N/A
  Fan Speeds (rpm): N/A
Info:
  Memory: total: 32 GiB available: 31.3 GiB used: 4.07 GiB (13.0%)
  Processes: 338 Uptime: 2h 25m Shell: Bash inxi: 3.3.37
Title: Re: Python 3 upgrade forces removal of hplip & friends
Post by: Teriarch on 2025/01/23, 18:57:00
Glad it worked!

And just to place my effort into the right perspective: It wasn't much,what I did!
I simply tricked the package manager into being less restrictive.
Sometimes it's overly cautious not to break anything,
when there is nothing to be broken.

But if I may ask for a favor, as a member of the siduction community board you
are in a much better position to suggest to the authors of hplip
the little changes for an intermediate official release. The community would
greatly benefit from the changes, and that is what it's all about.

Have a nice day

Title: Re: Python 3 upgrade forces removal of hplip & friends
Post by: dibl on 2025/01/23, 21:23:02
Quote from: Teriarch on 2025/01/23, 18:57:00
...
But if I may ask for a favor, as a member of the siduction community board you are in a much better position to suggest to the authors of hplip ...

I am flattered to be considered such a strong influencer, and I am willing to do anything I can to help the community.

However, we learned from the bug report in post #8 up this thread, the Debian Printing Team has been asleep since 9 JUL 2024, regarding the last bug reported. So, I don't see a way to wake them up with another report, or other way. Do you have an idea how to do it?
Title: Re: Python 3 upgrade forces removal of hplip & friends
Post by: debsid on 2025/01/24, 16:43:55
As someone whose printer has stopped working and has not yet tried a workaround, I'd like to support a wake-up call to the developers. It would be a great restoration.
Title: Re: Python 3 upgrade forces removal of hplip & friends
Post by: Teriarch on 2025/01/24, 21:00:05
I figured a minimally invasive method to address the problem w/o
modifying the original hplip packages. Hang on for a couple of days...
Title: Re: Python 3 upgrade forces removal of hplip & friends
Post by: seasons on 2025/01/24, 21:09:37
Quote from: Teriarch on 2025/01/23, 16:12:16
You should be able to install python3.12 w/o any removal. Both versions coexist just fine:

That's not the issue for me. The issue is that:
hplip : Depends: python3 (< 3.13) but 3.13.1-2 is to be installed
So I do have 3.12 installed as well, but of course, that doesn't make apt happy. I know how to work around that, but I don't need to print anything at the moment, so I'll wait.

I contacted the maintainer (Till Kamppeter) who updated Ubuntu's package, since he is also listed as a Debian maintainer, and I just saw him respond to an unrelated bug a few days ago. Maybe he can speed things along.
Title: Re: Python 3 upgrade forces removal of hplip & friends
Post by: eriefisher on 2025/01/24, 22:21:21
Has anyone tried to edit the control file to correct the dependency?
Title: Re: Python 3 upgrade forces removal of hplip & friends
Post by: seasons on 2025/01/24, 22:41:41
Till's response:
QuoteHi,
I am maintainer of the HPLIP package of Ubuntu and I had updated it already to 3.24.x, while at Debian no update had happened and even that I had informed the Debian maintainers that I have updated on Ubuntu, they did not overtake my updated package to Debian. There are also already bug reports in Debian's bug tracker about the need of an update, especially also for the current Python and GCC versions.

So I am CCing now Thorsten Alteholz, Debian maintainer for HPLIP and also the Debian Printing Team.

Also the freezes for the next release of Debian will start in March, so it would be nice to do not have a 2022 version of HPLIP in a 2025 release of Debian.
Title: Re: Python 3 upgrade forces removal of hplip & friends
Post by: Teriarch on 2025/01/24, 23:22:37
@seasons & @eriefisher

< That's not the issue for me.

What I meant is that python3.12 and python3.13 can coexist, but hplip unfortunately
depends on python3 (= 3.13). The latest python3-minimal on which python3 depends
contains a symbolic link from /usr/bin/python3 to /usr/bin/python3.13. That's why hplip
fails, even if it could be installed. The easiest way out is to modify the control file
of python 3 to contain an additional provide
Provides: ..., python3 (= 3.12)...
and patch the headers of hplip's python files to #!/usr/bin/python3.12 after the installation.
So no harm is done to the copyright.
But then the user of hplip' modification  is responsible for for an install of python3.12, which as I said
can live together with python3.13 happily ever after...
If you don't want to wait you can test the patch script on the iso live image in a couple of days.
Title: Re: Python 3 upgrade forces removal of hplip & friends
Post by: dibl on 2025/01/24, 23:32:08
Quote from: Teriarch on 2025/01/24, 23:22:37
.
If you don't want to wait you can test the patch script on the iso live image in a couple of days.

The workaround that @Teriarch made, described in post #10 on this thread, is working perfectly for my HP LaserJet Pro p1606dn, for 2 siduction systems in my home.
Title: Re: Python 3 upgrade forces removal of hplip & friends
Post by: Teriarch on 2025/01/25, 02:16:59
Please,please check the script first on the live shine-on iso image before you proceed.

If something fails you can always restart and report the failure. Be sure to have sudo
configured for the current user and don't worry if the hplip packages will get removed in
the process, you will get them back in a blink of an eye even before the script ends.

Have fun!


#!/usr/bin/bash

pushd .
sudo apt-get update
mkdir /tmp/hplip
mkdir /tmp/hptmp
cd /tmp/hplip
sudo apt-get install python3 python3.12
apt-get download python3
dpkg-deb -x /tmp/hplip/python3_3.13.1-2_amd64.deb /tmp/hptmp
dpkg-deb --control python3_3.13.1-2_amd64.deb /tmp/hptmp/DEBIAN
sed -i -e 's/python3-profiler/python3 (= 3.12), python3-profiler/g' /tmp/hptmp/DEBIAN/control
sed -i -e 's/Version: 3.13.1-2/Version: 3.13.1-2b/g' /tmp/hptmp/DEBIAN/control
dpkg-deb --root-owner-group -b /tmp/hptmp /tmp/hplip/python3_3.13.1-2b_amd64.deb
rm /tmp/hplip/python3_3.13.1-2_amd64.deb
sudo dpkg -i /tmp/hplip/*.deb
cd /tmp
rm -rf /tmp/hptmp /tmp/hplip

sudo apt-get install hplip hplip-data hplip-gui
grep -r '#!/usr/bin/python3' /usr/share/hplip /usr/lib/cups/backend 2>/dev/null|sed -e 's/:#!\/usr\/bin\/python3//g'|xargs -n1 sudo sed -i -e 's/\#\!\/usr\/bin\/python3/\#\!\/usr\/bin\/python3.12/g'
# grep -r '#!/usr/bin/python3' /usr/share/hplip /usr/lib/cups/backend 2>/dev/null|sed -e 's/:#!\/usr\/bin\/python3.12//g'|xargs -n1 sudo sed -i -e 's/\#\!\/usr\/bin\/python3.12/\#\!\/usr\/bin\/python3/g'
/usr/bin/hp-systray -x&
popd

Title: Re: Python 3 upgrade forces removal of hplip & friends
Post by: Teriarch on 2025/01/25, 15:37:29
A minor improvement to get rid of the version tracking in case
Python3 is getting an update (and don't forget to chmod 755 the
script before execution):


#!/usr/bin/bash

pushd .
sudo apt-get update
mkdir /tmp/hplip
mkdir /tmp/hptmp
cd /tmp/hplip
sudo apt-get install python3 python3.12
apt-get download python3
py3tmp=$(ls /tmp/hplip/*.deb)
py3tmpb=$(ls /tmp/hplip/*.deb|sed -e 's/_amd/b_amd/g')
py3ver=$(ls /tmp/hplip/*.deb|sed -e 's/\/tmp\/hplip\/python3_//g'|sed -e 's/_amd64.deb//g')
py3verb=$(ls /tmp/hplip/*.deb|sed -e 's/\/tmp\/hplip\/python3_//g'|sed -e 's/_amd64.deb/b/g')
dpkg-deb -x $py3tmp /tmp/hptmp
dpkg-deb --control $py3tmp /tmp/hptmp/DEBIAN
sed -i -e 's/python3-profiler/python3 (= 3.12), python3-profiler/g' /tmp/hptmp/DEBIAN/control
sed -i -e 's/Version: '$py3ver'/Version: '$py3verb'/g' /tmp/hptmp/DEBIAN/control
dpkg-deb --root-owner-group -b /tmp/hptmp $py3tmpb
rm $py3tmp
sudo dpkg -i $py3tmpb
cd /tmp
rm -rf /tmp/hptmp /tmp/hplip

sudo apt-get install hplip hplip-data hplip-gui
grep -r '#!/usr/bin/python3' /usr/share/hplip /usr/lib/cups/backend 2>/dev/null|sed -e 's/:#!\/usr\/bin\/python3//g'|xargs -n1 sudo sed -i -e 's/\#\!\/usr\/bin\/python3/\#\!\/usr\/bin\/python3.12/g'
# grep -r '#!/usr/bin/python3' /usr/share/hplip /usr/lib/cups/backend 2>/dev/null|sed -e 's/:#!\/usr\/bin\/python3.12//g'|xargs -n1 sudo sed -i -e 's/\#\!\/usr\/bin\/python3.12/\#\!\/usr\/bin\/python3/g'
/usr/bin/hp-systray -x&
popd

Title: Re: Python 3 upgrade forces removal of hplip & friends
Post by: sidemmc on 2025/01/28, 00:07:55
Nice! I have fun.
Title: Re: Python 3 upgrade forces removal of hplip & friends
Post by: finotti on 2025/01/29, 11:00:35
Quote from: Teriarch on 2025/01/25, 15:37:29
A minor improvement to get rid of the version tracking in case
Python3 is getting an update (and don't forget to chmod 755 the
script before execution):

[snip]

How will this affect future updates?  Will the modified hplip be replaced by the new official version when it is released?  Do we need to remove anything later on or take any special actions in the future?

I've been trying to hold for an official fix, as it makes me worried to hack packages like this (since I am not familiar with how it all works), but it is taking so long...
Title: Re: Python 3 upgrade forces removal of hplip & friends
Post by: Teriarch on 2025/01/29, 19:20:53
@finotti

> [...], as it makes me worried to hack packages like this

To the less experienced the script might look a little scary, but I assure you:
There is nothing to be scared of (That's what they mean, when they say: "Minimally invasive").

> How will this affect future updates?

It won't. If hplip get's an update, so be it. The patched files will be replaced by the new ones (which
hopefully will work this time) and that's it. And the package manager is not aware of the previous
changes, since we patched after the install.

If python3 gets an update before hplip does, hplip will be removed in the process. But you can run
the script again to allow for another life cycle of ancient hplip (as long as python3 remains compatible
with python3.12 nothing happens).

> Will the modified hplip be replaced by the new official version when it is released?

Yes it will. As soon as there is a new release available. Not a single trace will remain.

> Do we need to remove anything later on or take any special actions in the future?

No, we don't. As soon as new releases will be available the old ones will be replaced
and the twilight disappears.

Rest assured that the main concern is always the regular course of events.
Title: Re: Python 3 upgrade forces removal of hplip & friends
Post by: finotti on 2025/01/29, 21:46:21
Thanks @Teriarch for the clarifications and reassurances.  (And, mostly, for the fix!)  I will try your script tomorrow morning.
Title: Re: Python 3 upgrade forces removal of hplip & friends
Post by: Teriarch on 2025/01/29, 22:46:52
@finotti

Lest the script get the user executed,
for all the love of Betsy I would suggest you give it
one more try on the life shine-on iso image until
you feel more uncomfortable with it for the final go, ;-)
Title: Re: Python 3 upgrade forces removal of hplip & friends
Post by: finotti on 2025/01/31, 16:16:32
Quote from: Teriarch on 2025/01/29, 22:46:52
@finotti

Lest the script get the user executed,
for all the love of Betsy I would suggest you give it
one more try on the life shine-on iso image until
you feel more uncomfortable with it for the final go, ;-)

FWIW: I ran the script yesterday, and so far, so good.  Thanks for your help!
Title: Re: Python 3 upgrade forces removal of hplip & friends
Post by: Teriarch on 2025/01/31, 17:22:20
Perfect! You're welcome.
Title: Re: Python 3 upgrade forces removal of hplip & friends
Post by: Biram on 2025/01/31, 21:47:44
I've run into the same problem before with updates breaking stuff like printers or specific packages I rely on. I had to hold off on upgrading a few things myself to keep my printer working, which is an old HP LaserJet. It's frustrating, but holding packages back has been a good workaround for now. Hopefully, they'll fix the dependency issue soon, but I agree—definitely something to watch out for if you're relying on hplip.

Title: Re: Python 3 upgrade forces removal of hplip & friends
Post by: Teriarch on 2025/02/01, 15:26:46
@Biram

> , which is an old HP LaserJet.

I've got myself an old HP 2300 Laser Jet with almost 30k pages of output.
It's reliable as hell. These machines are indestructible. But nowadays they
don't build them like this anymore. Anyway, do you know about the advantage
of hplip over cups? My printer is running fine with cups. Is hplip worthwhile
considering?
Title: Re: Python 3 upgrade forces removal of hplip & friends
Post by: seasons on 2025/02/06, 23:30:33
For those of you who removed hplip, a fixed version is available today.
Title: Re: Python 3 upgrade forces removal of hplip & friends
Post by: debsid on 2025/02/10, 10:25:05
Just FYI. I am one of those who let hplip go, as the printer on my system had stopped working with my Linux laptop. I installed the fixed hplip a couple of days ago, but have noticed that my HP LaserJet still does not print on my laptop.