pyproj: ValueError: array.array size changed, may indicate binary incompatibility on PyPy

Importing pyproj 3.0.1 on PyPy for Windows raises the following error:

Python 3.7.10 (77787b8f4c49, May 15 2021, 11:51:36)
[PyPy 7.3.5 with MSC v.1927 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>>> import pyproj
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "X:\pypy3\site-packages\pyproj\__init__.py", line 64, in <module>
    from pyproj.proj import Proj, pj_list  # noqa: F401
  File "X:\pypy3\site-packages\pyproj\proj.py", line 21, in <module>
    from pyproj._transformer import Factors, _Transformer
  File "pyproj\_transformer.pyx", line 1, in init pyproj._transformer
ValueError: array.array size changed, may indicate binary incompatibility. Expected 72 from C header, got 24 from PyObject

The issue is that there is “no clean C interface to the array.array object in Python”. See discussion at https://github.com/h5py/h5py/issues/1514 and https://github.com/h5py/h5py/pull/1515 for a possible fix.

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 2
  • Comments: 22 (8 by maintainers)

Most upvoted comments

I have once again recompiled the pyproj package for PyPy and it is importing again. I think this issue is due to Cython producing incompatible versions of C files when cythonizing on CPython vs PyPy, which makes it hard and error prone to build CPython and PyPy wheels from the same copy of the source without removing the cythonized files in between builds.

Thank you! Do you think it is safe to start building for pypy3.8-v7.3.7?