Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError: module 'numpy.linalg.lapack_lite' has no attribute '_ilp64' #1460

Closed
alyferryhalo opened this issue Jun 24, 2021 · 9 comments
Labels

Comments

@alyferryhalo
Copy link

DeepPavlov version : 0.15.0

Python version: 3.8.5

Operating system: Linux Ubuntu 20.04

Issue:

Command that led to error:

from deeppavlov import configs, build_model

ner_model = build_model(configs.ner.ner_rus_bert, download=True) #This will download the model if not present
text = 'Однажды весною, в час небывало жаркого заката, в Москве, на Патриарших прудах, появились два гражданина.'
result = ner_model([text])

for i in range(len(result[0][0])):
     print(result[0][0][i], result[1][0][i])

Error (including full traceback):


AttributeError                            Traceback (most recent call last)
<ipython-input-3-7052722efa23> in <module>
      2 
      3 
----> 4 ner_model = build_model(configs.ner.ner_rus_bert, download=True) #This will download the model if not present
      5 text = 'Однажды весною, в час небывало жаркого заката, в Москве, на Патриарших прудах, появились два гражданина.'
      6 result = ner_model([text])

~/.local/lib/python3.8/site-packages/deeppavlov/core/commands/infer.py in build_model(config, mode, load_trained, download, serialized)
     60             component_serialized = None
     61 
---> 62         component = from_params(component_config, mode=mode, serialized=component_serialized)
     63 
     64         if 'id' in component_config:

~/.local/lib/python3.8/site-packages/deeppavlov/core/common/params.py in from_params(params, mode, serialized, **kwargs)
     93         log.exception(e)
     94         raise e
---> 95     obj = get_model(cls_name)
     96 
     97     if inspect.isclass(obj):

~/.local/lib/python3.8/site-packages/deeppavlov/core/common/registry.py in get_model(name)
     72             raise ConfigError("Model {} is not registered.".format(name))
     73         return cls_from_str(name)
---> 74     return cls_from_str(_REGISTRY[name])
     75 
     76 

~/.local/lib/python3.8/site-packages/deeppavlov/core/common/registry.py in cls_from_str(name)
     40                           .format(name))
     41 
---> 42     return getattr(importlib.import_module(module_name), cls_name)
     43 
     44 

/usr/lib/python3.8/importlib/__init__.py in import_module(name, package)
    125                 break
    126             level += 1
--> 127     return _bootstrap._gcd_import(name[level:], package, level)
    128 
    129 

/usr/lib/python3.8/importlib/_bootstrap.py in _gcd_import(name, package, level)

/usr/lib/python3.8/importlib/_bootstrap.py in _find_and_load(name, import_)

/usr/lib/python3.8/importlib/_bootstrap.py in _find_and_load_unlocked(name, import_)

/usr/lib/python3.8/importlib/_bootstrap.py in _call_with_frames_removed(f, *args, **kwds)

/usr/lib/python3.8/importlib/_bootstrap.py in _gcd_import(name, package, level)

/usr/lib/python3.8/importlib/_bootstrap.py in _find_and_load(name, import_)

/usr/lib/python3.8/importlib/_bootstrap.py in _find_and_load_unlocked(name, import_)

/usr/lib/python3.8/importlib/_bootstrap.py in _call_with_frames_removed(f, *args, **kwds)

/usr/lib/python3.8/importlib/_bootstrap.py in _gcd_import(name, package, level)

/usr/lib/python3.8/importlib/_bootstrap.py in _find_and_load(name, import_)

/usr/lib/python3.8/importlib/_bootstrap.py in _find_and_load_unlocked(name, import_)

/usr/lib/python3.8/importlib/_bootstrap.py in _load_unlocked(spec)

/usr/lib/python3.8/importlib/_bootstrap_external.py in exec_module(self, module)

/usr/lib/python3.8/importlib/_bootstrap.py in _call_with_frames_removed(f, *args, **kwds)

~/.local/lib/python3.8/site-packages/deeppavlov/models/__init__.py in <module>
     15 import os
     16 
---> 17 import nltk
     18 
     19 from deeppavlov.core.common.prints import RedirectedPrints

~/.local/lib/python3.8/site-packages/nltk/__init__.py in <module>
    127 # Import top-level functionality into top-level namespace
    128 
--> 129 from nltk.collocations import *
    130 from nltk.decorators import decorator, memoize
    131 from nltk.featstruct import *

~/.local/lib/python3.8/site-packages/nltk/collocations.py in <module>
     38 from nltk.util import ngrams
     39 # these two unused imports are referenced in collocations.doctest
---> 40 from nltk.metrics import ContingencyMeasures, BigramAssocMeasures, TrigramAssocMeasures, QuadgramAssocMeasures
     41 from nltk.metrics.spearman import ranks_from_scores, spearman_correlation
     42 

~/.local/lib/python3.8/site-packages/nltk/metrics/__init__.py in <module>
     14 """
     15 
---> 16 from nltk.metrics.scores import (
     17     accuracy,
     18     precision,

~/.local/lib/python3.8/site-packages/nltk/metrics/scores.py in <module>
     16 
     17 try:
---> 18     from scipy.stats.stats import betai
     19 except ImportError:
     20     betai = None

~/.local/lib/python3.8/site-packages/scipy/stats/__init__.py in <module>
    382 from __future__ import division, print_function, absolute_import
    383 
--> 384 from .stats import *
    385 from .distributions import *
    386 from .morestats import *

~/.local/lib/python3.8/site-packages/scipy/stats/stats.py in <module>
    177 
    178 from scipy._lib.six import callable, string_types
--> 179 from scipy.spatial.distance import cdist
    180 from scipy.ndimage import measurements
    181 from scipy._lib._version import NumpyVersion

~/.local/lib/python3.8/site-packages/scipy/spatial/__init__.py in <module>
     95 from __future__ import division, print_function, absolute_import
     96 
---> 97 from .kdtree import *
     98 from .ckdtree import *
     99 from .qhull import *

~/.local/lib/python3.8/site-packages/scipy/spatial/kdtree.py in <module>
      6 import numpy as np
      7 from heapq import heappush, heappop
----> 8 import scipy.sparse
      9 
     10 __all__ = ['minkowski_distance_p', 'minkowski_distance',

~/.local/lib/python3.8/site-packages/scipy/sparse/__init__.py in <module>
    227 import warnings as _warnings
    228 
--> 229 from .base import *
    230 from .csr import *
    231 from .csc import *

~/.local/lib/python3.8/site-packages/scipy/sparse/base.py in <module>
      5 
      6 from scipy._lib.six import xrange
----> 7 from scipy._lib._numpy_compat import broadcast_to
      8 from .sputils import (isdense, isscalarlike, isintlike,
      9                       get_sum_dtype, validateaxis, check_reshape_kwargs,

~/.local/lib/python3.8/site-packages/scipy/_lib/_numpy_compat.py in <module>
     14 
     15 if NumpyVersion(np.__version__) > '1.7.0.dev':
---> 16     _assert_warns = np.testing.assert_warns
     17 else:
     18     def _assert_warns(warning_class, func, *args, **kw):

~/.local/lib/python3.8/site-packages/numpy/__init__.py in __getattr__(attr)
    211                 from .testing import Tester
    212                 return Tester
--> 213             else:
    214                 raise AttributeError("module {!r} has no attribute "
    215                                      "{!r}".format(__name__, attr))

~/.local/lib/python3.8/site-packages/numpy/testing/__init__.py in <module>
      8 from unittest import TestCase
      9 
---> 10 from ._private.utils import *
     11 from ._private import decorators as dec
     12 from ._private.nosetester import (

~/.local/lib/python3.8/site-packages/numpy/testing/_private/utils.py in <module>
     50 IS_PYPY = platform.python_implementation() == 'PyPy'
     51 HAS_REFCOUNT = getattr(sys, 'getrefcount', None) is not None
---> 52 HAS_LAPACK64 = numpy.linalg.lapack_lite._ilp64
     53 
     54 

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


@zhanhuifeng
Copy link

Me too, spent 2 hours to find where I can get "numpy.linalg.lapack_lite._ilp64", but failure. At first I want to add # ahead "HAS_LAPACK64 = numpy.linalg.lapack_lite._ilp64", but others will use HAS_LAPACK64.

@jashwanthsoamsila
Copy link

jashwanthsoamsila commented Jan 25, 2022

well I too have same error
i unistall numpy and again installed it.
after that i faced the same error so, i checked whether my numpy folder is in packages or not
since latest version is installed in site-packages. it is not in packages folder so, i pasted the same in packages folder too
this time it didn't raise attribute error

@Hamed-Aghapanah
Copy link

problem solved with :

1 - pip uninstall -y numpy
2 - pip uninstall -y setuptools
3 - pip install setuptools or conda install setuptools
4 - pip install bumpy or conda install numpy
Any one will work. Conda/pip

@kopyl
Copy link

kopyl commented Nov 9, 2023

pip install bumpy

Got me an error:

Collecting bumpy
  Using cached bumpy-0.4.3.tar.gz (8.9 kB)
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error
  
  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [9 lines of output]
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/tmp/pip-install-djv1nl8s/bumpy_2b89f09fec8d4303a4b34a84a5223c7f/setup.py", line 1, in <module>
          import bumpy
        File "/tmp/pip-install-djv1nl8s/bumpy_2b89f09fec8d4303a4b34a84a5223c7f/bumpy.py", line 157
          except Exception, ex:
                 ^^^^^^^^^^^^^
      SyntaxError: multiple exception types must be parenthesized
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

@kopyl
Copy link

kopyl commented Nov 9, 2023

@IgnatovFedor plz reopen it

@Psyhackological
Copy link

@kopyl it was a typo, change from bumpy to numpy.

@kopyl
Copy link

kopyl commented Nov 13, 2023

@Psyhackological thank you. Unfortunately i don't even remember what i needed this thing for :(

@Realvincentyuan
Copy link

problem solved with :

1 - pip uninstall -y numpy 2 - pip uninstall -y setuptools 3 - pip install setuptools or conda install setuptools 4 - pip install bumpy or conda install numpy Any one will work. Conda/pip

This also works in Google Colab as of 1/10/2024.

@thierrydecae
Copy link

for me, this worked using Colab on 29/02/24:
pip install numpy==1.24.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

9 participants