Skip to content

undefined symbol: PyPyUnicode_ReadChar #20014

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
yuan8901 opened this issue Apr 18, 2021 · 4 comments · Fixed by #20037
Closed

undefined symbol: PyPyUnicode_ReadChar #20014

yuan8901 opened this issue Apr 18, 2021 · 4 comments · Fixed by #20037
Assignees
Milestone

Comments

@yuan8901
Copy link

When I tried to run matplotlib with pypy3, I got the following error. pypy version [PyPy 7.3.1 with GCC 9.3.0]. Matplotlib version
matplotlib-3.3.4-pp36-pypy36_pp73-manylinux2010_x86_64.whl

from . import ft2font
pypy3.6/site-packages/matplotlib/ft2font.pypy36-pp73-x86_64-linux-gnu.so: undefined symbol: PyPyUnicode_ReadChar

@tacaswell
Copy link
Member

I can not reproduce this, but I only have access to

✔ 19:41:06 $ python --version
Python 3.7.10 (51efa818fd9b24f625078c65e8e2f6a5ac24d572, Apr 11 2021, 13:25:22)
[PyPy 7.3.4 with GCC 10.2.0]

which pulls matplotlib-3.3.4-pp37-pypy37_pp73-manylinux2010_x86_64.whl

attn @mattip .

@mattip
Copy link
Contributor

mattip commented Apr 19, 2021

That C-API function was added in PyPy v.7.3.2. Please update to the latest PyPy version.

@jklymak
Copy link
Member

jklymak commented Apr 19, 2021

Lets close for now, but @yuan8901 please ping us if that doesn't fix the problem.

@jklymak jklymak closed this as completed Apr 19, 2021
@anntzer
Copy link
Contributor

anntzer commented Apr 20, 2021

If the pypy wheels can't specify micro-release version requirements, perhaps the version check at the point of use

#if defined(PYPY_VERSION) && (PYPY_VERSION_NUM  < 0x07030200)
        Py_UNICODE *unistr = PyUnicode_AsUnicode(textobj);
        for (size_t i = 0; i < size; ++i) {
            codepoints[i] = unistr[i];
        }
#else
        for (size_t i = 0; i < size; ++i) {
            codepoints[i] = PyUnicode_ReadChar(textobj, i);
        }
#endif

should just use a version bound of 0x07040000? This way the wheels stay always valid, even though they may use a slightly less optimal version on PyPy 7.3.{0,1}.

@anntzer anntzer reopened this Apr 20, 2021
@anntzer anntzer self-assigned this Apr 21, 2021
@QuLogic QuLogic added this to the v3.4.2 milestone Apr 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants