python-cffi / cffi

A Foreign Function Interface package for calling C libraries from Python.
https://cffi.readthedocs.io/en/latest/
Other
114 stars 41 forks source link

"errorMessage": "No module named '_cffi_backend'", #50

Closed pmeakins closed 4 months ago

pmeakins commented 8 months ago

Upgraded from AWS lambda runtime python 3.7 (EOL) to 3.9, getting this , any suggestions on a workaround??

{ "errorMessage": "No module named '_cffi_backend'", "errorType": "ModuleNotFoundError", "requestId": "redacted", "stackTrace": [ " File \"/var/task/lambda_function.py\", line 6, in lambda_handler\n ffi = cffi.FFI()\n", " File \"/var/task/cffi/api.py\", line 48, in init\n import _cffi_backend as backend\n" ] }

api.py if backend is None:

You need PyPy (>= 2.0 beta), or a CPython (>= 2.6) with

_cffi_backend.so compiled.

import _cffi_backend as backend

arigo commented 8 months ago

I'm just guessing, but it seems that the new Python version on AWS doesn't come with cffi pre-installed and you must install it yourself. As a guess, it was the same with the old version and you were using a version of it that someone else already installed cffi in.

nitzmahone commented 4 months ago

Likely an environment configuration issue- closing for inactivity.