This traceback mess up all my program and I still cant fix it I have tried all methods and it didn't help!
Here's the problem:
ffi_prep_closure(): bad user_data (it seems that the version of the libffi library seen at runtime is different from the 'ffi.h' file seen at compile-time)
This happens on some recent linux distributions - the binary wheel published on PyPI is not compatible with system libffi. Following will reinstall the package and build it locally on the system without using precompiled binaries published on PyPI:
pip install --force-reinstall --no-binary :all: cffi
PS: Installing libffi-dev
(.deb based distros such as Ubuntu or Debian) or libffi-devel
(.rpm based distros such as Fedora) might be needed before this.
The problem also maybe be in a python version. I am using Fedora Linux, and it is always one python version ahead before gcloud
. So I had python3.10
and then I installed supported by google-cloud-sdk
python3.9
and pointed google-cloud-sdk to that version of python by adding a new path to .bashrc
: export CLOUDSDK_PYTHON=python3.9
I just did an upgrade and now the error dissapeared:
pip install --upgrade cffi xcffib
You might have to use su
(or sudo su
) before actually doing the update depending on what packages setup you want to target.
PS: I'm on Ubuntu so I used su
before actually doing the upgrade
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With