Björn Höfling <[email protected]> writes:
> [env]# ls $GUIX_ENVIRONMENT/lib
> libXss.a libXss.so libXss.so.1.0.0 libbfd.la libopcodes.la
> libpython2.7.so.1.0 libz.so.1 pkgconfig
> libXss.la libXss.so.1 libbfd.a libopcodes.a libpython2.7.so
> libz.so libz.so.1.2.11 python2.7
>
> [env]# python
> Python 2.7.15 (default, Jan 1 1970, 00:00:01)
> [GCC 5.5.0] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
>>>> import ctypes;
>>>> from ctypes import *;
>>>> libc=CDLL("libc.so.6");
>>>> libc
> <CDLL 'libc.so.6', handle 7fac69a4b550 at 7fac69733110>
>>>> libz=CDLL("libz.so.1");
> Traceback (most recent call last):
> File "<stdin>", line 1, in <module>
> File
> "/gnu/store/aws3fsg614lqr392y5pp9w65dy7gmvlx-python2-2.7.15/lib/python2.7/ctypes/__init__.py",
> line 366, in __init__
> self._handle = _dlopen(self._name, mode)
> OSError: libz.so.1: cannot open shared object file: No such file or directory
Using the full file name would work, for example:
./pre-inst-env guix environment --ad-hoc python zlib -- \
python3 -c "import os; import ctypes;
libz=ctypes.CDLL(os.environ['GUIX_ENVIRONMENT']+'/lib/libz.so.1')"
--
Ricardo