coincurve icon indicating copy to clipboard operation
coincurve copied to clipboard

Unable to install in pypy

Open pacrob opened this issue 8 months ago • 6 comments

Attempting to install coincurve in both pypy3.10 and pypy3.11 on Ubuntu results in:

        File "/tmp/pip-install-qfbnaz4o/coincurve_afdb4624c0fc432786b913d146e8d692/hatch_build.py", line 26, in initialize
          cffi_shared_lib = _cffi_backend.__file__
      AttributeError: module '_cffi_backend' has no attribute '__file__'

I've gone through the install docs, but no dice. Any recommendations?

pacrob avatar Apr 26 '25 15:04 pacrob

I also just ran into this issue. Have you had any luck resolving it?

The line in question is this one: https://github.com/ofek/coincurve/blob/4285045a4cf9ec7a09121b0c85721baaaf76180a/hatch_build.py#L26

jkexbx avatar May 26 '25 17:05 jkexbx

Have you had any luck resolving it?

Nothing yet.

pacrob avatar May 26 '25 18:05 pacrob

It would help if one of you could run PyPy with CFFI installed and then print(dir(_cffi_backend))

ofek avatar May 26 '25 19:05 ofek

It would help if one of you could run PyPy with CFFI installed and then print(dir(_cffi_backend))

In [1]: !python --version
Python 3.10.16 (64367dfeb263, Feb 24 2025, 17:31:14)
[PyPy 7.3.19 with GCC 10.2.1 20210130 (Red Hat 10.2.1-11)]

In [2]: import _cffi_backend

In [3]: print(dir(_cffi_backend))
['CField', 'CLibrary', 'CType', 'FFI', 'FFI_CDECL', 'FFI_DEFAULT_ABI', 'Lib', 'RTLD_DEEPBIND', 'RTLD_GLOBAL', 'RTLD_LAZY', 'RTLD_LOCAL', 'RTLD_NODELETE', 'RTLD_NOLOAD', 'RTLD_NOW', '_CDataBase', '__CData_iterator', '__FFIAllocator', '__FFIFunctionWrapper', '__FFIGlobSupport', '__doc__', '__loader__', '__name__', '__package__', '__spec__', '__version__', '_get_common_types', '_get_types', '_offset_in_bytes', 'alignof', 'buffer', 'callback', 'cast', 'complete_struct_or_union', 'from_buffer', 'from_handle', 'gcp', 'get_errno', 'getcname', 'load_library', 'memmove', 'new_array_type', 'new_enum_type', 'new_function_type', 'new_pointer_type', 'new_primitive_type', 'new_struct_type', 'new_union_type', 'new_void_type', 'newp', 'newp_handle', 'rawaddressof', 'release', 'set_errno', 'sizeof', 'string', 'typeof', 'typeoffsetof', 'unpack']

pacrob avatar May 26 '25 22:05 pacrob

Per PyPy, they are recommending that since it's already installed in PyPy, that it shouldn't be attempted to install again.

https://github.com/python-cffi/cffi/issues/173

jkexbx avatar Jun 01 '25 04:06 jkexbx

That seems like a good approach, thanks.

ofek avatar Jun 01 '25 14:06 ofek