Testing on staging branch, discovered libffi-3.4.2 will break existing pyenv installs. Solution

For python development, I use pyenv extensively.

I updated my system to the stable-staging branch which caused libffi to upgrade from 3.3-4 to 3.4.2-4.

This causes an upgrade from libffi.so.7 to libffi.so.8 but python versions installed with pyenv prior to this upgrade will expect the system to have libffi.so.7 so if you try and pip install a python module wit C bindings, it will fail with ImportError: libffi.so.7: cannot open shared object file: No such file or directory

The fix is to uninstall the problematic version of python with pyenv and then re-install it. This will mean you also need to remake any pyenv virtualenvs using that version of python.

You don’t have to uninstall the version. It should be enough to install the same version again (e.g. pyenv install 3.9.8). Then, you don’t need to recreate all your virtual envs.