brent timothy saner via plug on 15 May 2020 18:27:16 -0700
|
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
Re: [PLUG] Fixing a Python library mismatch
|
- From: brent timothy saner via plug <plug@lists.phillylinux.org>
- To: plug@lists.phillylinux.org
- Subject: Re: [PLUG] Fixing a Python library mismatch
- Date: Fri, 15 May 2020 21:26:30 -0400
- Autocrypt: addr=brent.saner@gmail.com; prefer-encrypt=mutual; keydata= mQINBFKm0mgBEADSI5oeyqRYZ8YWxPbux4CeqaMNh4etuyJmglDRCQB9t1XlvhMDLZWQNqm+ ORBN3YGISUu+X55p10lK/O1w/85zXkAV7Qe6fkvUzSx0tbPWLu4rn4zH9JgTExElhFRv143H W/EKehejEetkNz6JSwGUXNiF5qh1GbKLOmShbmCSKXLcmw05Qj4ELmhkH9OWXpeM0EHmWIEK VSeoIim/g1MYYxKOb1wY3DEubY9zn3lfz9xfLq/xlFMepDyNAEer/qZDSHQqnymdqXlt6L9e mfd4snHLiDfUgG9JOPeMDWeT6XWJDtKKCcZ3JDSMEGgZsFYpwJxJEwPxnfhHJmH8ENxi/8Cu 0fLFvzgAP+VK/Z1egBI7l241fDDREg3e+NWFhUM5bjwBmqk1z8nkRdru+QSMtPl6Erkd+Tbp 7lGGpQwCbI6esdBPkx/nV8+fIPEcsR2G5jG7O9U4J6q3B1nRFrR863SJHudIWV/l59ZvA8kI knDYNOixPLmnoRrO7LNIWe9jpnkZdg34Aa5AjAjGEKwY5EAzqkKuPEMVGqg/36YUcnqYS98W iVgCpaGg6KJqCMVXBfugxd79rtkyT4Oeju/z/Yp2xxXm3Pqcocb1CxbiEYDLJNT7/hyIJ072 4asMz2DTDMIMciP93hPraEtINknPlerNX2XqK03D+gyBGqAL7QARAQABtCtCcmVudCBUaW1v dGh5IFNhbmVyIDxicmVudC5zYW5lckBnbWFpbC5jb20+iQI8BBMBAgAmAhsDBwsJCAcDAgEG FQgCCQoLBBYCAwECHgECF4AFAlLzvnsCGQEACgkQjAB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relaxed/relaxed; d=gmail.com; s=20161025; h=to:references:from:autocrypt:subject:message-id:date:user-agent :mime-version:in-reply-to; bh=lr6ujDGqNAxQDH+D7HmTwgtes6Fl55Cw0bRm6cdZVvg=; b=OA+weF4szja/u5FWzvRgziDf2Wv45BQi6lrWz2+QUHR8SSNmDrE04dfqZNToYynAbR +cZm9qxV00uS+8pMll89gk0OVcVueGDlGI3m+B0hH3tROPtNJM8y06q4Wev6LF5qz3Gz nE1Q7/oh41qZuV74WIyb3kaAyCrYPM91S5RZTgIzTaH3Ys60qHQLyY4ncNUsb4JfJhlB Js5jxFZ09juIzpYU281OmkJjLjrY2QBs1B9DsqG2Vz/sihP2/NvHJQDakJp+pJPvNZsm rVPncoKElAbFFwDl6Vb41QLuIKaIyq567o6I4Cr6SNcotJhBzFCTpa38p963o2UHan4z i1Dg==
- Reply-to: brent timothy saner <brent.saner@gmail.com>
- Sender: "plug" <plug-bounces@lists.phillylinux.org>
- User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0
On 5/15/20 20:59, Walt Mankowski via plug wrote:
> Today I discovered that when I try to import numpy I'm getting the
> following error:
>
> % python
> Python 3.8.2 (default, Apr 9 2020, 20:21:36)
> [GCC 9.2.1 20191008] on linux
> Type "help", "copyright", "credits" or "license" for more information.
>>>> import numpy
> Traceback (most recent call last):
> File "<stdin>", line 1, in <module>
> File "/home/waltman/.pyenv/versions/3.8.2/lib/python3.8/site-packages/numpy/__init__.py", line 142, in <module>
> from . import core
> File "/home/waltman/.pyenv/versions/3.8.2/lib/python3.8/site-packages/numpy/core/__init__.py", line 102, in <module>
> from . import _dtype_ctypes
> File "/home/waltman/.pyenv/versions/3.8.2/lib/python3.8/site-packages/numpy/core/_dtype_ctypes.py", line 25, in <module>
> import _ctypes
> ImportError: libffi.so.6: cannot open shared object file: No such file or directory
>
> This almost certainly broke when I updated to Ubuntu 20.04 a few weeks
> ago. It probably removed libffi.so.6 and replaced it with
> libffi.so.7. I can't figure out how to rebuild numpy with the new
> library. I've tried `pip uninstall numpy; pip install numpy` but that
> didn't have any effect.
>
> Anyone have any suggestions on how to fix it? I'm using pyenv and pip.
>
> Walt
three ways to fix:
ONE: the proper, stable way
use numpy and python 3 from the ubuntu repositories. this ensures the
modules and system libraries are always in sync (unless a packager
somewhere made an oopsie).
TWO A: the "i don't like the proper, stable way" way
a.k.a. the "i know better than the distro packagers" way
just recreate your env. i'd recommend using venv rather than pyenv,
though, since it's stdlib in python3.3+
(https://docs.python.org/3/library/venv.html). since it looks like
you're using python3.8, and assuming it's installed system-wide,
python3.8 -m venv some_venv_dir
TWO B: the "fuck that" way
uninstall numpy from your pyenv and reinstall it. as long as it doesn't
keep a build cache, it should build from whatever libffi is available.
THREE: the honeybadger way
a.k.a. the yolo way
this is a hack, but it works 9 times out of 10.
just symlink the lib.
cd /usr/lib64[0]
ln -s libffi.so[1] libffi.so.6
[0] i don't know where ubuntu installs libffi to. it might be /usr/lib/,
etc. "find / -type f -iname "libffi*.so" will find it for you.
[1] libffi.so, if it exists, is probably just a symlink to libffi.so.7.
but it should be okay; you max out at 5 symlink levels. this would be
only 2. you want to symlink to the .so instead of .so.7 directly because
that's always going to point to the newest lib and the link won't break
on package update. if the .so link does NOT exist, just link .so.6 to
.so.7 and remember to update it.
TWO: the proper way
Attachment:
signature.asc
Description: OpenPGP digital signature
___________________________________________________________________________
Philadelphia Linux Users Group -- http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion -- http://lists.phillylinux.org/mailman/listinfo/plug