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

Cameron Simpson cs at cskk.id.au
Wed Dec 16 16:24:47 EST 2020


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.

>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.

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.

>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?

>Is there *any* other way around this, like a 'compatibility module' to
>use Python 2 .so files in Python 3 or anything like it?  I have all
>the Python code and have (up to hitting this problem) converted it to
>Python 3.

Almost certainly not. I think ChrisA's Python 2 suggestion is the go 
here.

You may need to manually copy the requisite .so files if the package is 
about to vanish.

Cheers,
Cameron Simpson <cs at cskk.id.au>


More information about the Python-list mailing list