-
오류 증상
'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' >>>
'Python' 카테고리의 다른 글
파이썬 object(개체) 비교(is, == 처리) (0) 2023.09.03 PyGame 소리 sound file 재생(wav, mp3 등) (0) 2023.08.17 Python - dict() for문 key value 처리 (0) 2023.07.13 파이썬 파일 경로 슬러쉬 (0) 2023.07.12 UUID(GUID) 생성 (0) 2023.07.06 Python Streamlit 시각화(웹서비스) (0) 2023.02.05 Python Re 정규식 예제1 (0) 2023.01.15 Python bs4.BeautifulSoup (0) 2022.12.16