0

When install confluent_kafka on pypy5.6, its has an error of : undefined symbol PyUnicode_FromFormat Error, i dont know how its happend ?

the os is: CentOs5.6

the full error output is :

Python 2.7.12 (aff251e543859ce4508159dd9f1a82a2f553de00, Nov 12 2016, 08:50:18)
[PyPy 5.6.0 with GCC 6.2.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
import confluent_kafka

Traceback (most recent call last): File "", line 1, in File "/usr/local/pypy/site-packages/confluent_kafka/init.py", line 2, in from .cimpl import * ImportError: unable to load extension module '/usr/local/pypy/site-packages/confluent_kafka/cimpl.pypy-41.so': /usr/local/pypy/site-packages/confluent_kafka/cimpl.pypy-41.so: undefined symbol: PyUnicode_FromFormat

How can I resolve this issue?

Joel
  • 1,564
  • 7
  • 12
  • 20

1 Answers1

0

PyUnicode_FromFormat is not implemented so far inside PyPy. We'll get to it at some point (maybe soon if you have an example that requires it). You can also contribute it directly, if you want to get involved.

FWIW it is implemented in the py3.5 branch implementing Python 3.5, but not in trunk (supporting Python 2.7). Trunk only implements PyString_FromFormat. It's mostly a matter of back-porting the implementation, and "downgrading" the C code: in py3.5 it comes from CPython 3.5, so for trunk we'd need the same C code from CPython 2.7 instead.

Armin Rigo
  • 12,048
  • 37
  • 48
  • thanks !! i think i use another version of python while be fast ! – zhaoqinghui Feb 22 '17 at 15:26
  • The PyMongo BSON C extension needs this functionality. Unfortunately, the pure-python fallback fails on some timestamps in their oplog and the recommended solution by mongo devs is to use the C extension, which is unsupported in PyPy as of now. Ref: https://github.com/mongodb-labs/mongo-connector/issues/279#issuecomment-147862759 – Roee Shenberg Oct 15 '17 at 08:52
  • 1
    ``PyUnicode_FromFormat()`` is provided in PyPy2 5.9. – Armin Rigo Oct 15 '17 at 16:35
  • Thanks! Naturally, there are a few more missing functions now that that one was implemented. I'll look into implementing them since it all seems pretty simple. – Roee Shenberg Nov 08 '17 at 14:05