Error using cffi 1.15.0 with _ffi_prep_closure error

995 views
Skip to first unread message

Jessie Jessie

unread,
Mar 9, 2022, 12:15:34 AM3/9/22
to python-cffi
Hi I've M1 chip Mac and when I tried to install pycares==4.0.0, I encountered errors with _ffi_prep_closure. 


Error Message:
ImportError: dlopen(venv/lib/python3.9/site-packages/_cffi_backend.cpython-39-darwin.so, 0x0002): symbol not found in flat namespace '_ffi_prep_closure'

My environment: Python 3.8.10

>brew list | grep ffi

>libffi


I've tried to reinstall cffi in the following 2 methods, but does fix the issue.
Method1:
>pip uninstall cffi
>pip install --no-binary cffi==1.15.0

method2:
>pip uninstall cffi
>LDFLAGS=-L$(brew --prefix libffi)/lib CFLAGS=-I$(brew --prefix libffi)/include venv/bin/pip install cffi==1.15.0 --no-binary :all:


I've also tried to reinstall wheel/setuptools but does not work:
>pip install --upgrade pip==21.2.4
>pip install wheel==0.37.0 setuptools==57.4.0

I've also reinstall brew by the following, but does not work.


Can you help to identify my issue here?

Reply all
Reply to author
Forward
0 new messages