Python 2 to Python 3 .so library incompatibility - need help

Chris Green cl at isbd.net
Wed Dec 16 16:59:17 EST 2020


Cameron Simpson <cs at cskk.id.au> wrote:
> On 16Dec2020 18:51, Chris Green <cl at isbd.net> wrote:
> >The specific problem that finally prevented me from managing to get it
> >to work was a (Linux) .so file that had been built for Python 2 and,
> >as I don't have the source, I can't build for Python 3.
> 
> ChrisA I think suggested keeping a Python 2.7 install around for this.
> 
Not possible really as there are other python conflicts that start
appearing if one tries to retain the libraries needed.


> >I need to have another go at fixing this as otherwise the code that I
> >need to manage my printer will stop working as I update my Ubuntu
> >systems.
> 
> Have you considered keeping a legacy VM around as well? I have a few VMs 
> sitting here I use for some legacy software.
> 
That's not a lot of use.  The programs that I want to run (by
converting to Python 3) are utility programs for my printer, they
install with a handy 'app' in my toolbar.  Having them in a VM
wouldn't really do much good! :-)


> Have you checked an upgraded Ubuntu to failure to run your software 
> using Python 2? Python 2 won't be installed by default, but I'm pretty 
> sure you can add it in. It is just the "system Python" which is moving 
> to Python 3.
> 
> Also, make note of the specific Python 2 version where your software 
> works - the CPython API does change somewhat sometimes.
> 
I still have python 2.  The issue is that the programs need modules
which come from a PPA to support Python GTK, these conflict with
ongoing updates to Python.  The PPA works OK in Ubuntu 20.04 but
prevents some updates in 20.10.  I expect it will get worse as time
goes on.


> >The specific error I'm getting is as follows:-
> >    File "/usr/libexec/okimfputl.new/guicom.py", line 66, in <module> import pyscand
> >    ImportError: /usr/libexec/okimfpdrv/pyscand.so: undefined symbol: _Py_ZeroStruct
> 
> 
> Guessing from the library name, have you looked on the OKI.com site for 
> current software? Maybe here? What's your printer model?
> 
>     https://www.oki.com/au/printing/support/drivers-and-utilities/index.html
> 
> Not that I've found anything helpful...
> 
> What Ubuntu package supplies that .so file?
> 
It comes from OKI with the Linux utilities for the printer, it's an
MC342N.

I have tried asking them for a Python 3 version, maybe I should try
again.

-- 
Chris Green
·


More information about the Python-list mailing list