Ubuntu 20.04 upgrade, Python missing libffi.so.6

后端 未结 6 1695
暗喜
暗喜 2021-02-06 20:59

I recently upgraded my OS to Ubuntu 20.04 LTS.

Now when I try to import a library like Numpy in Python, I get the following error:

ImportError: libffi.so.6         


        
6条回答
  •  野趣味
    野趣味 (楼主)
    2021-02-06 21:58

    I am using Xubuntu 20.04 and recompiling the python version 3.7 did not work for me.

    The way I solved this was to download the 19.10 version of the package from here: http://mirrors.kernel.org/ubuntu/pool/main/libf/libffi/libffi6_3.2.1-8_amd64.deb

    and then installing it

    sudo apt install ./libffi6_3.2.1-8_amd64.deb
    

    This will unpack the libffi.so.6 and libffi.so.6.0.4 files to /usr/lib/x86_64-linux-gnu/. The libffi.so.6 file is just a link to libffi.so.6.0.4 in the same directory.

    As far as I could see this does not overwrite any files so should be safe.

    Hopefully this helps someone as well.

提交回复
热议问题