ABOUT ME

-

Today
-
Yesterday
-
Total
-
  • 오류해결 - module compiled against API version 0xf but this version of numpy is 0xd
    Search: Python Python 2023. 8. 13. 10:24

     

    오류 증상

    'module compiled against API version 0xf but this version of numpy is 0xd'
    'ImportError: numpy.core.multiarray failed to import'

    id1@rp1:~ $ python
    Python 3.9.2 (default, Mar 12 2021, 04:06:34)
    [GCC 10.2.1 20210110] on linux
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import cv2
    RuntimeError: module compiled against API version 0xf but this version of numpy is 0xd
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "/home/id1/.local/lib/python3.9/site-packages/cv2/__init__.py", line 181, in <module>
        bootstrap()
      File "/home/id1/.local/lib/python3.9/site-packages/cv2/__init__.py", line 153, in bootstrap
        native_module = importlib.import_module("cv2")
      File "/usr/lib/python3.9/importlib/__init__.py", line 127, in import_module
        return _bootstrap._gcd_import(name[level:], package, level)
    ImportError: numpy.core.multiarray failed to import
    >>>
    id1@rp1:~ $

     

    오류 해결

     

    'pip install numpy --upgrade'
    를 입력하여 최신 버전으로 맞춤

     

    테스트

    id1@rp1:~ $
    id1@rp1:~ $ pip install numpy
    Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
    Requirement already satisfied: numpy in /usr/lib/python3/dist-packages (1.19.5)
    id1@rp1:~ $ pip install numpy --upgrade
    Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
    Requirement already satisfied: numpy in /usr/lib/python3/dist-packages (1.19.5)
    Collecting numpy
      Downloading https://www.piwheels.org/simple/numpy/numpy-1.25.2-cp39-cp39-linux_armv7l.whl (12.5 MB)
         |████████████████████████████████| 12.5 MB 132 kB/s
    Installing collected packages: numpy
    Successfully installed numpy-1.25.2

     

    id1@rp1:~ $ python
    Python 3.9.2 (default, Mar 12 2021, 04:06:34)
    [GCC 10.2.1 20210110] on linux
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import cv2
    >>> cv2.__version__
    '4.6.0'
    >>>

     

    댓글