GNU bug report logs - #63912
python-scikit-learn can't be imported "module compiled against API version 0x10 but this version of numpy is 0xf"

Previous Next

Package: guix;

Reported by: Edouard Klein <edk <at> beaver-labs.com>

Date: Mon, 5 Jun 2023 16:53:02 UTC

Severity: normal

Done: Edouard Klein <edou <at> rdklein.fr>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 63912 in the body.
You can then email your comments to 63912 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-guix <at> gnu.org:
bug#63912; Package guix. (Mon, 05 Jun 2023 16:53:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Edouard Klein <edk <at> beaver-labs.com>:
New bug report received and forwarded. Copy sent to bug-guix <at> gnu.org. (Mon, 05 Jun 2023 16:53:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Edouard Klein <edk <at> beaver-labs.com>
To: bug-guix <bug-guix <at> gnu.org>
Subject: python-scikit-learn can't be imported "module compiled against API
 version 0x10 but this version of numpy is 0xf"
Date: Mon, 05 Jun 2023 18:50:35 +0200
Dear Guix maintainers,

If I run:
guix shell python-scikit-learn
and in it, run:
python3 -c "from sklearn.feature_extraction.text import CountVectorizer"
I get:
RuntimeError: module compiled against API version 0x10 but this version of numpy is 0xf . Check the section C-API incompatibility at the Troubleshooting ImportError section at https://numpy.org/devdocs/user/troubleshooting-importerror.html#c-api-incompatibility for indications on how to solve this problem .
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib/python3.10/site-packages/sklearn/__init__.py", line 82, in <module>
    from .base import clone
  File "/usr/lib/python3.10/site-packages/sklearn/base.py", line 17, in <module>
    from .utils import _IS_32BIT
  File "/usr/lib/python3.10/site-packages/sklearn/utils/__init__.py", line 17, in <module>
    from scipy.sparse import issparse
  File "/usr/lib/python3.10/site-packages/scipy/sparse/__init__.py", line 267, in <module>
    from ._csr import *
  File "/usr/lib/python3.10/site-packages/scipy/sparse/_csr.py", line 10, in <module>
    from ._sparsetools import (csr_tocsc, csr_tobsr, csr_count_blocks,
ImportError: numpy.core.multiarray failed to import

I can't look into it right now, but I'm available to provide any
necessary information.

Cheers,

Edouard.




Reply sent to Edouard Klein <edou <at> rdklein.fr>:
You have taken responsibility. (Wed, 14 Jun 2023 06:43:02 GMT) Full text and rfc822 format available.

Notification sent to Edouard Klein <edk <at> beaver-labs.com>:
bug acknowledged by developer. (Wed, 14 Jun 2023 06:43:02 GMT) Full text and rfc822 format available.

Message #10 received at 63912-done <at> debbugs.gnu.org (full text, mbox):

From: Edouard Klein <edou <at> rdklein.fr>
To: 63912-done <at> debbugs.gnu.org
Subject: Re: bug#63912: Acknowledgement (python-scikit-learn can't be
 imported "module compiled against API version 0x10 but this version of
 numpy is 0xf")
Date: Wed, 14 Jun 2023 08:38:52 +0200
I found the cause:

.local/lib/python3.10/site-packages/  is part of the interpreter's load
path, and so an old version of numpy was imported in priority over
guix's.

I don't know if this is by design, but if so, it means that any
pip --user installed package will overshadow any guix install package,
even when giving --pure to guix shell. It may not be what we want.

What made me find this is that sklearn worked when in a container, but
not in a shell, that meant that something from the local system was
leaking into the shell.



help-debbugs <at> gnu.org (GNU bug Tracking System) writes:

> Thank you for filing a new bug report with debbugs.gnu.org.
>
> This is an automatically generated reply to let you know your message
> has been received.
>
> Your message is being forwarded to the package maintainers and other
> interested parties for their attention; they will reply in due course.
>
> Your message has been sent to the package maintainer(s):
>  bug-guix <at> gnu.org
>
> If you wish to submit further information on this problem, please
> send it to 63912 <at> debbugs.gnu.org.
>
> Please do not send mail to help-debbugs <at> gnu.org unless you wish
> to report a problem with the Bug-tracking system.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 12 Jul 2023 11:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 287 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.