Skip to content

Can't import numpy via other libraries - module 'numpy.linalg._umath_linalg' has no attribute '_ilp64' #25906

@devinbost

Description

@devinbost

Steps to reproduce:

Create a new Google Colab notebook
Run !pip install -qU pandas==1.5.3 scipy torch==2.1.0 numpy==1.26.4 implicit

It should output:

Found existing installation: numpy 1.26.4
Uninstalling numpy-1.26.4:
  Successfully uninstalled numpy-1.26.4
Collecting numpy
  Using cached numpy-1.26.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (18.2 MB)
Installing collected packages: numpy
Successfully installed numpy-1.26.4

Run:
from implicit.als import AlternatingLeastSquares

I've run into this same exception when attempting to import several other libraries as well that use numpy, not just the implicit library.

Error message:

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-18-10b22e354f54> in <cell line: 2>()
      1 # Imports
----> 2 from implicit.als import AlternatingLeastSquares
      3 from datetime import datetime
      4 from pathlib import Path
      5 

8 frames
/usr/local/lib/python3.10/dist-packages/numpy/testing/_private/utils.py in <module>
     55 IS_PYSTON = hasattr(sys, "pyston_version_info")
     56 HAS_REFCOUNT = getattr(sys, 'getrefcount', None) is not None and not IS_PYSTON
---> 57 HAS_LAPACK64 = numpy.linalg._umath_linalg._ilp64
     58 
     59 _OLD_PROMOTION = lambda: np._get_promotion_state() == 'legacy'

AttributeError: module 'numpy.linalg._umath_linalg' has no attribute '_ilp64'


### Additional information:

Using Python 3 with CPU runtime.
Python 3.10.12

Metadata

Metadata

Assignees

No one assigned

    Labels

    32 - InstallationProblems installing or compiling NumPy57 - Close?Issues which may be closable unless discussion continued

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions