• Options for running a legacy python 2.7 app in Debian 12

    From Chris Green@21:1/5 to All on Thu Nov 7 00:20:01 2024
    I have an OKI scanner which has a neat little linux app for running it
    from a linux desktop. However it hasn't been updated from python 2.7
    days and I'm looking at ways I might get it to run on my recently
    upgraded Debian 12 system.

    I managed for a while to keep it running on systems which no longer
    have python 2.7 by building a cxfreeze environment but this is no
    longer viable.

    The scanner applet builds and runs successfully on an old system I
    have which runs xubuntu 18.04.

    So my options seem to be:-

    Keep the xubuntu 18.04 system and run the app there via Remmina or
    something similar. The downsides are the extra power consumption
    and the slightly clumsy interface via Remmina.

    As above but simply use X to run the app on my desktop. If this
    works it is a bit 'tidier' but still has the extra power
    consumption.

    Try the cxfreeze build again. This may work but I think it's
    becoming less viable.

    Build the app into something like an appimage. I've looked into
    this a bit but it feels a bit complicated and again I'm not sure
    about its long term viability.

    Run xubuntu 18.04 (or similar) in a virtual machine, I used to use
    virtualbox for running Windows XP but I haven't for a while. It
    does rather seem overkill for just one app though.

    Is there any sort of 'ready made' python 2.7 virtual environment
    available?

    Anything else?

    The ideal would be some sort of mini virtualbox type of environment
    that supports python 2.7.

    --
    Chris Green
    ·

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Andy Smith@21:1/5 to Chris Green on Thu Nov 7 07:10:01 2024
    Hi Chris,

    On Wed, Nov 06, 2024 at 10:54:17PM +0000, Chris Green wrote:
    I have an OKI scanner which has a neat little linux app for running it
    from a linux desktop. However it hasn't been updated from python 2.7
    days and I'm looking at ways I might get it to run on my recently
    upgraded Debian 12 system.

    I'm pretty sure that someone somewhere is maintaining a Python 2
    compatible interpreter so I'd probably install that from source
    somewhere and use that as the interpreter just for this one app.

    It is my understanding that no other project can call itself "Python"
    due to trademark laws so forks of Python 2 have to call themselves
    something else. One example would be Tauthon:

    https://github.com/naftaliharris/tauthon

    I have never tried it.

    It seems like a lot of work for what must be itself an abandoned app
    (otherwise it would have Python 3 support by now).

    Thanks,
    Andy

    --
    https://bitfolk.com/ -- No-nonsense VPS hosting

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Arno Lehmann@21:1/5 to All on Thu Nov 7 08:30:01 2024
    Hi Chris,

    Am 06.11.2024 um 23:54 schrieb Chris Green:
    I have an OKI scanner which has a neat little linux app for running it
    from a linux desktop. However it hasn't been updated from python 2.7
    days and I'm looking at ways I might get it to run on my recently
    upgraded Debian 12 system.

    I managed for a while to keep it running on systems which no longer
    have python 2.7 by building a cxfreeze environment but this is no
    longer viable.

    I understand your goal is to use your scanner, not run Python 2.7. If
    that's not the situation, ignore my below suggestion :-)

    If that's the case, I suggest you check out VueScan found at
    www.hamrick.com which has become a great tool to keep working hardware
    in use and even "unlock" features, as vendor supplied scanning software
    is more often than not rather terrible.

    Anyway, they do have a search function for scanners at the start page,
    do not seem to do much user tracking on the web site, offer a free trial version, and are pretty good with support. Not open source software,
    though, but I actually understand why...

    Cheers,

    Arno

    --
    Arno Lehmann

    IT-Service Lehmann
    Sandstr. 6, 49080 Osnabrück

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Chris Green@21:1/5 to Xiyue Deng on Thu Nov 7 09:50:01 2024
    Xiyue Deng <manphiz@gmail.com> wrote:
    [-- text/plain, encoding quoted-printable, charset: utf-8, 61 lines --]

    Chris Green <cl@isbd.net> writes:

    [snip]

    The ideal would be some sort of mini virtualbox type of environment
    that supports python 2.7.


    Using Docker/Podman to run a container with an old version of Linux distribution that support Python 2.7 could be the most power-saving
    option (e.g. Debian Bullseye a.k.a. oldstable.) Using a Docker means no hypervisor required and application running in a container runs at near-bear-metal speed thanks to kernel support. Additionally you got
    some level of isolation from your host so that some of the unsupported
    old Python 2 vulnerabilities are under control within your container
    (not bullet-proof, but still something.)

    That sounds like a good idea, thank you, not a full-blown virtual
    machine but somewhat in that direction. I did consider docker for
    something a while ago but didn't actually do it, I'll have to have
    another look.

    --
    Chris Green
    ·

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Chris Green@21:1/5 to Andy Smith on Thu Nov 7 09:30:01 2024
    Andy Smith <andy@strugglers.net> wrote:
    Hi Chris,

    On Wed, Nov 06, 2024 at 10:54:17PM +0000, Chris Green wrote:
    I have an OKI scanner which has a neat little linux app for running it
    from a linux desktop. However it hasn't been updated from python 2.7
    days and I'm looking at ways I might get it to run on my recently
    upgraded Debian 12 system.

    I'm pretty sure that someone somewhere is maintaining a Python 2
    compatible interpreter so I'd probably install that from source
    somewhere and use that as the interpreter just for this one app.

    It is my understanding that no other project can call itself "Python"
    due to trademark laws so forks of Python 2 have to call themselves
    something else. One example would be Tauthon:

    https://github.com/naftaliharris/tauthon

    I have never tried it.

    It seems like a lot of work for what must be itself an abandoned app (otherwise it would have Python 3 support by now).

    It's a fairly old printer but it is still supported (drivers etc. for
    windows 11) but they've never updated the Linux scanner driver, I
    don't suppose there's that much demand for it. It's a very neat
    little app though so I'd like to keep using it.

    --
    Chris Green
    ·

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Loris Bennett@21:1/5 to Chris Green on Thu Nov 7 10:30:01 2024
    Chris Green <cl@isbd.net> writes:

    Andy Smith <andy@strugglers.net> wrote:
    Hi Chris,

    On Wed, Nov 06, 2024 at 10:54:17PM +0000, Chris Green wrote:
    I have an OKI scanner which has a neat little linux app for running it
    from a linux desktop. However it hasn't been updated from python 2.7
    days and I'm looking at ways I might get it to run on my recently
    upgraded Debian 12 system.

    I'm pretty sure that someone somewhere is maintaining a Python 2
    compatible interpreter so I'd probably install that from source
    somewhere and use that as the interpreter just for this one app.

    It is my understanding that no other project can call itself "Python"
    due to trademark laws so forks of Python 2 have to call themselves
    something else. One example would be Tauthon:

    https://github.com/naftaliharris/tauthon

    I have never tried it.

    It seems like a lot of work for what must be itself an abandoned app
    (otherwise it would have Python 3 support by now).

    It's a fairly old printer but it is still supported (drivers etc. for
    windows 11) but they've never updated the Linux scanner driver, I
    don't suppose there's that much demand for it. It's a very neat
    little app though so I'd like to keep using it.

    The following suggestion is almost certainly overkill and probably more
    work to set up than simply porting the application to Python 3.

    On HPC systems, multiple versions of software packages are often
    installed parallel to the packages provided by the operating system. So
    the system I work with runs AlmaLinux 8.10, which provides Python
    2.7.18 and Python 3.6.8. However, in addition to these version we also
    have a number of other versions of Python namely:

    Python/2.7.14-intel-2018a
    Python/2.7.15-foss-2018b
    Python/2.7.15-GCCcore-8.2.0
    Python/2.7.15-intel-2018b
    Python/2.7.16-GCCcore-8.3.0
    Python/2.7.18-GCCcore-9.3.0
    Python/2.7.18-GCCcore-10.2.0
    Python/3.6.4-foss-2018a
    Python/3.6.4-intel-2018a
    Python/3.6.6-foss-2018b
    Python/3.6.6-fosscuda-2018b
    Python/3.6.6-intel-2018b
    Python/3.7.2-GCCcore-8.2.0
    Python/3.7.4-GCCcore-8.3.0
    Python/3.8.2-GCCcore-9.3.0
    Python/3.8.6-GCCcore-10.2.0
    Python/3.9.5-GCCcore-10.3.0
    Python/3.9.6-GCCcore-11.2.0
    Python/3.10.4-GCCcore-11.3.0
    Python/3.10.8-GCCcore-12.2.0
    Python/3.11.3-GCCcore-12.3.0
    Python/3.11.5-GCCcore-13.2.0
    Python/3.12.3-GCCcore-13.3.0

    (The suffix after the version refers to the toolchain, the main
    component of which is the compiler, used to build the software).

    These are installed using EasyBuild[1] (no Debian package), which allows
    one to install pieces of (mostly scientific) software plus all
    dependencies with a single command. The desired version can then be
    chosen by using Lmod[2] (Debian package: lmod).

    Like I say, probably overkill for the case here, but possibly useful for someone.

    Cheers,

    Loris


    Footnotes:
    [1] https://easybuild.io/
    [2] https://lmod.readthedocs.io

    --
    This signature is currently under constuction.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Chris Green@21:1/5 to Loris Bennett on Thu Nov 7 12:20:02 2024
    Loris Bennett <loris.bennett@fu-berlin.de> wrote:
    Chris Green <cl@isbd.net> writes:

    Andy Smith <andy@strugglers.net> wrote:
    Hi Chris,

    On Wed, Nov 06, 2024 at 10:54:17PM +0000, Chris Green wrote:
    I have an OKI scanner which has a neat little linux app for running it >> > from a linux desktop. However it hasn't been updated from python 2.7
    days and I'm looking at ways I might get it to run on my recently
    upgraded Debian 12 system.

    I'm pretty sure that someone somewhere is maintaining a Python 2
    compatible interpreter so I'd probably install that from source
    somewhere and use that as the interpreter just for this one app.

    It is my understanding that no other project can call itself "Python"
    due to trademark laws so forks of Python 2 have to call themselves
    something else. One example would be Tauthon:

    https://github.com/naftaliharris/tauthon

    I have never tried it.

    It seems like a lot of work for what must be itself an abandoned app
    (otherwise it would have Python 3 support by now).

    It's a fairly old printer but it is still supported (drivers etc. for windows 11) but they've never updated the Linux scanner driver, I
    don't suppose there's that much demand for it. It's a very neat
    little app though so I'd like to keep using it.

    The following suggestion is almost certainly overkill and probably more
    work to set up than simply porting the application to Python 3.

    I would if I could, but there are .so files built for Python 2 that
    don't work in Python 3, my notes say:-

    So I tried to convert it all to Python 3, I had converted all my own code (including
    some Gtk stuff) to Python 3 so it seemed it should be possible. All went well until:-

    File "/usr/libexec/okimfputl.new/guicom.py", line 66, in <module>
    import pyscand
    ImportError: /usr/libexec/okimfpdrv/pyscand.so: undefined symbol: _Py_ZeroStruct

    This is because the module pyscand.so has been compiled for Python 2 and produces
    the above error when you try using it from Python 3, since I don't have the source
    code for pyscand.so I'm stuck.


    There isn't by any chance a tool/utility somewhere for converting
    Python 2 .so files to Python 3 is there?

    --
    Chris Green
    ·

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)