unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
From: zimoun <zimon.toutoune@gmail.com>
To: Wojtek Kosior <koszko@koszko.org>
Cc: mprodrigues@posteo.net, help-guix@gnu.org
Subject: Re: Problem loading numpy and other on a venv in a guix system
Date: Wed, 30 Nov 2022 13:37:43 +0100	[thread overview]
Message-ID: <87lenssjmw.fsf@gmail.com> (raw)
In-Reply-To: <20221130094733.5a91acf6@koszkonutek-tmp.pl.eu.org>

Hi,

On Wed, 30 Nov 2022 at 09:47, Wojtek Kosior via <help-guix@gnu.org> wrote:

      cd /tmp/
>     guix shell python python-virtualenv coreutils
>     virtualenv -p python3 somedirectory
>     . ./somedirectory/bin/activate
>     pip install numpy
      python3 -c 'import numpy'

leads to,

--8<---------------cut here---------------start------------->8---
Traceback (most recent call last):
  File "/tmp/somedirectory/lib/python3.9/site-packages/numpy/core/__init__.py", line 23, in <module>
    from . import multiarray
  File "/tmp/somedirectory/lib/python3.9/site-packages/numpy/core/multiarray.py", line 10, in <module>
    from . import overrides
  File "/tmp/somedirectory/lib/python3.9/site-packages/numpy/core/overrides.py", line 6, in <module>
    from numpy.core._multiarray_umath import (
ImportError: libz.so.1: cannot open shared object file: No such file or directory

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/tmp/somedirectory/lib/python3.9/site-packages/numpy/__init__.py", line 140, in <module>
    from . import core
  File "/tmp/somedirectory/lib/python3.9/site-packages/numpy/core/__init__.py", line 49, in <module>
    raise ImportError(msg)
ImportError: 

IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!

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.

We have compiled some common reasons and troubleshooting tips at:

    https://numpy.org/devdocs/user/troubleshooting-importerror.html

Please note and check the following:

  * The Python version is: Python3.9 from "/tmp/somedirectory/bin/python3"
  * The NumPy version is: "1.23.5"

and make sure that they are the versions you expect.
Please carefully study the documentation linked above for further help.

Original error was: libz.so.1: cannot open shared object file: No such file or directory
--8<---------------cut here---------------end--------------->8---

That’s because the Numpy from pip is linked to system-wide library,

--8<---------------cut here---------------start------------->8---
$ ldd somedirectory/lib/python3.9/site-packages/numpy/core/_multiarray_umath.cpython-39-x86_64-linux-gnu.so
	linux-vdso.so.1 (0x00007ffde12e0000)
	libopenblas64_p-r0-742d56dc.3.20.so => /tmp/somedirectory/lib/python3.9/site-packages/numpy/core/../../numpy.libs/libopenblas64_p-r0-742d56dc.3.20.so (0x00007f6f1223d000)
	libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f6f120dd000)
	libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f6f120ba000)
	libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f6f11ec8000)
	/lib64/ld-linux-x86-64.so.2 (0x00007f6f1481a000)
	libgfortran-040039e1.so.5.0.0 => /tmp/somedirectory/lib/python3.9/site-packages/numpy/core/../../numpy.libs/libgfortran-040039e1.so.5.0.0 (0x00007f6f11a3b000)
	libquadmath-96973f99.so.0.0.0 => /tmp/somedirectory/lib/python3.9/site-packages/numpy/core/../../numpy.libs/libquadmath-96973f99.so.0.0.0 (0x00007f6f117fc000)
	libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f6f117e0000)
	libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f6f117c5000)
--8<---------------cut here---------------end--------------->8---

and they are not found.  Well, if you are running Guix on foreign
distro, you can manually fix the issue with this “missing” libz library
by setting LD_LIBRARY_PATH=/lib/x86_64-linux-gnu/.  But you get another
issue:

--8<---------------cut here---------------start------------->8---
$ LD_LIBRARY_PATH=/lib/x86_64-linux-gnu/ python3 -c 'import numpy'
python3: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.33' not found (required by /gnu/store/lvip6h5pamjwmvnkwg60sjb63ph8698k-python-3.9.9/lib/libpython3.9.so.1.0)
python3: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.32' not found (required by /gnu/store/lvip6h5pamjwmvnkwg60sjb63ph8698k-python-3.9.9/lib/libpython3.9.so.1.0)
--8<---------------cut here---------------end--------------->8---

Well, I do not know if the Guix package “python-virtualenv” is working
in “guix shell”.


Cheers,
simon


      parent reply	other threads:[~2022-11-30 12:41 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-29 16:42 Problem loading numpy and other on a venv in a guix system mprodrigues
2022-11-29 18:33 ` Wojtek Kosior via
2022-11-30  9:42   ` mprodrigues
2022-11-30 11:21     ` Wojtek Kosior via
2022-11-30  8:13 ` zimoun
2022-11-30  8:47   ` Wojtek Kosior via
2022-11-30  9:46     ` mprodrigues
2022-11-30 12:07       ` zimoun
2022-11-30 12:37     ` zimoun [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87lenssjmw.fsf@gmail.com \
    --to=zimon.toutoune@gmail.com \
    --cc=help-guix@gnu.org \
    --cc=koszko@koszko.org \
    --cc=mprodrigues@posteo.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).