티스토리 뷰
'ValueError: numpy.ndarray size changed, may indicate binary incompatibility' 에러 수정하기
맨날치킨 2022. 12. 14. 16:05Stack Overflow에 자주 검색, 등록되는 문제들과 제가 개발 중 찾아 본 문제들 중에서 나중에도 찾아 볼 것 같은 문제들을 정리하고 있습니다.
Stack Overflow에서 가장 먼저 확인하게 되는 가장 높은 점수를 받은 Solution과 현 시점에 도움이 될 수 있는 가장 최근에 업데이트(최소 점수 확보)된 Solution을 각각 정리하였습니다.
아래 word cloud를 통해 이번 포스팅의 주요 키워드를 미리 확인하세요.
ValueError: numpy.ndarray size changed, may indicate binary incompatibility. Expected 88 from C header, got 80 from PyObject
ValueError: numpy.ndarray 크기가 변경되었습니다. 이진 비호환성을 나타낼 수 있습니다. C 헤더에서 88이 예상되고 PyObject에서 80이 예상됩니다.
문제 내용
Importing from pyxdameraulevenshtein gives the following error, I have
pyxdameraulevenshtein에서 가져오면 다음 오류가 발생합니다.
pyxdameraulevenshtein==1.5.3,
pandas==1.1.4 and
scikit-learn==0.20.2.
Numpy is 1.16.1.
Works well in Python3.6, Issue in Python3.7.
Has anyone been facing similar issues with Python3.7 (3.7.9), docker image - python:3.7-buster
Python 3.7(3.7.9), 도커 이미지 - Python: 3.7-buster와 유사한 문제에 직면한 사람이 있나요?
__init__.pxd:242: in init pyxdameraulevenshtein
???
E ValueError: numpy.ndarray size changed, may indicate binary incompatibility. Expected 88 from C header, got 80 from PyObject
높은 점수를 받은 Solution
I'm in Python 3.8.5. It sounds too simple to be real, but I had this same issue and all I did was reinstall numpy. Gone.
저는 파이썬 3.8.5에 있습니다. 진짜라고 하기에는 너무 간단하게 들리지만, 저는 이와 같은 문제가 있었고 제가 한 것이라고는 numpy를 다시 설치하는 것뿐이었습니다.
pip install --upgrade numpy
or
또는
pip uninstall numpy
pip install numpy
가장 최근 달린 Solution
This worked for me (when nothing else on this page did):
이것은 나에게 효과가 있었습니다.(이 페이지의 다른 것은 아무 것도 효과가 없었다):
# Create environment with conda or venv.
# Do *not* install any other packages here.
pip install numpy==1.21.5
# Install all other packages here.
# This works as a package may build against the currently installed version of numpy.
This solved a particularly brutal issue that was unresolvable by all other answers on this page as of 2022-04-11:
이것은 2022-04-11년 현재 이 페이지의 다른 모든 답변으로 해결할 수 없는 특히 잔인한 문제를 해결했습니다.
Other answers try to fix the problem after it occurred, this fixes the problem before it occurs.
다른 대답은 문제가 발생한 후에 문제를 해결하려고 시도합니다. 이렇게 하면 문제가 발생하기 전에 문제가 해결됩니다.
In addition, experiment with different versions of Python, e.g. 3.8, 3.9, 3.10.
또한 Python의 다른 버전(예: 3.8, 3.9, 3.10)에서 실험하세요.
Reference: Excellent answer by @FZeiser that explains why this works.
참조: 왜 이것이 작동하는지 설명하는 @FZeiser의 훌륭한 답변입니다.
출처 : https://stackoverflow.com/questions/66060487/valueerror-numpy-ndarray-size-changed-may-indicate-binary-incompatibility-exp
'개발 > 파이썬' 카테고리의 다른 글
읽기와 쓰기 모두를 위해 파일을 여는 방법은 무엇입니까? (0) | 2022.12.14 |
---|---|
값에 따라 리스트 아이템을 삭제하는 쉬운 방법 (0) | 2022.12.14 |
파일의 줄 내용 검색하여 바꾸기 (0) | 2022.12.14 |
두 리스트 간의 차이로 새로운 리스트 만들기 (0) | 2022.12.14 |
리스트 del, remove 및 pop의 차이 (0) | 2022.12.13 |