From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) Subject: bug#30229: Python modules installed by pip in virtualenv can't find shared objects. Date: Wed, 24 Jan 2018 16:01:42 +0100 Message-ID: <87k1w7xpux.fsf@gnu.org> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:34761) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eeMYz-0000XM-U4 for bug-guix@gnu.org; Wed, 24 Jan 2018 10:02:16 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eeMYt-0002h1-SJ for bug-guix@gnu.org; Wed, 24 Jan 2018 10:02:09 -0500 Received: from debbugs.gnu.org ([208.118.235.43]:33297) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eeMYt-0002gd-Og for bug-guix@gnu.org; Wed, 24 Jan 2018 10:02:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1eeMYr-0000fr-KY for bug-guix@gnu.org; Wed, 24 Jan 2018 10:02:03 -0500 Sender: "Debbugs-submit" Resent-Message-ID: In-Reply-To: (Fis Trivial's message of "Tue, 23 Jan 2018 11:49:59 +0000") List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org Sender: "bug-Guix" To: Fis Trivial Cc: 30229@debbugs.gnu.org Hi, Fis Trivial skribis: > In my case, it's lightgbm (installed by pip), needs libgomp.so from gcc:l= ib for > openmp support. Here is the backtrace: > > Traceback (most recent call last): > File "ex1.py", line 5, in > import lightgbm as lgb > File "/home/fis/Workspace/tianchi/medical_treatment/lib/python3.5/site-= packages/lightgbm/__init__.py", line 8, in > from .basic import Booster, Dataset > File "/home/fis/Workspace/tianchi/medical_treatment/lib/python3.5/site-= packages/lightgbm/basic.py", line 32, in > _LIB =3D _load_lib() > File "/home/fis/Workspace/tianchi/medical_treatment/lib/python3.5/site-= packages/lightgbm/basic.py", line 27, in _load_lib > lib =3D ctypes.cdll.LoadLibrary(lib_path[0]) > File "/gnu/store/jb3n0bsdpkhvyb8y70jyr8fcx8fqssr9-python-3.5.3/lib/pyth= on3.5/ctypes/__init__.py", line 425, in LoadLibrary > return self._dlltype(name) > File "/gnu/store/jb3n0bsdpkhvyb8y70jyr8fcx8fqssr9-python-3.5.3/lib/pyth= on3.5/ctypes/__init__.py", line 347, in __init__ > self._handle =3D _dlopen(self._name, mode) > OSError: libgomp.so.1: cannot open shared object file: No such file or di= rectory I=E2=80=99d suggest hard-coding the absolute file name of libgomp.so.1 in lightgbm/basic.py. This is what we do, for instance, for Guile packages that use the foreign function interface (FFI) and dynamically load shared libraries (see =E2=80=98guile-gdbm-ffi=E2=80=99 as an example.) HTH, Ludo=E2=80=99.