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

Chris Green cl at isbd.net
Wed Dec 16 13:51:54 EST 2020


Some time ago (in July) I asked some questions here
about problems migrating some code from Python 2 to Python 3.  

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.

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.

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

I know this is because the extension module is compiled for Python 2
and _Py_ZeroStruct is only available in Python 2.  I don't have the C
code for the module. 

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.


-- 
Chris Green
·


More information about the Python-list mailing list