Hi Mateus!
Indeed, when using virtualenv's numpy, this
python3 -c 'import numpy'
fails with the error you posted. I seem to have been able to make numpy
happy by instead running Python like
LD_LIBRARY_PATH=/gnu/store/8qv5kb2fgm4c3bf70zcg9l6hkf3qzpw9-zlib-1.2.11/lib/
python3 -c 'import numpy'
If you use the `--container` and `--emulate-fhs` options to
`guix shell`, it is also possible to instead do
LD_LIBRARY_PATH=/usr/lib/ python3 -c 'import numpy'
The `libz` guix package still needs to be included among the packages
passed to `guix shell` in this last case.
Also, given you're using virtualenv, you might find the `--network`
option to `guix shell` useful :)
I hope there isn't any dumb mistake in my solution... Good luck :)
Wojtek
-- (sig_start)
website: https://koszko.org/koszko.html
PGP: https://koszko.org/key.gpg
fingerprint: E972 7060 E3C5 637C 8A4F 4B42 4BC5 221C 5A79 FD1A
Meet Kraków saints! #27: blessed Maria Klemensa Staszewska
Poznaj świętych krakowskich! #27: błogosławiona Maria Klemensa
Staszewska
https://pl.wikipedia.org/wiki/Maria_Klemensa_Staszewska
-- (sig_end)
On Tue, 29 Nov 2022 16:42:14 +0000
mprodrigues@posteo.net wrote:
Hello,
I've been using a guix shell with a couple of python packages and it
works fine,
however I'd also like to keep the option of using a virtualenv if
possible, the
thing is I'm having problem running modules like numpy, that depend on
non
python dependencies. The error I get when I try to load numpy in a
venv
is:
Importing the numpy C-extensions failed. This error can happen for
many
reasons,
often due to issues with your setup or how NumPy was installed.
and in the end:
Original error was: libz.so.1: cannot open shared object file: No such
file or
directory
I have tried installing zlib directly, also tried to add my default
profile libs
path to the venv PATH, but to no avail until now. How can I solve
this?
Or
maybe someone can point me in the direction that I have to take to
properly
debug this.
Best regards,
Mateus Rodrigues