728x90
반응형
에러 코드
AttributeError: module 'numpy' has no attribute 'complex'.
`np.complex` was a deprecated alias for the builtin `complex`.
To avoid this error in existing code, use `complex` by itself. Doing this will not modify any behavior and is safe.
If you specifically wanted the numpy scalar type, use `np.complex128` here.
The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at:
https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
원인
numpy 버전 1.20부터 np.complex는 deprecated 되었고, 1,24 부터는 완전히 제거되어서 사용할 수 없다고 합니다.
해결법
1. np.complex128 로 변경해보자.
클래스 이름이 바뀌었으니 코드도 수정해보자.
2. pip install numpy==1.19.5 넘파이 버전 변경
코드를 수정하기 어려운 상황이라면 넘파이 버전을 다운그레이드 해보자.
궁금한 점이 있으시다면 댓글 남겨주세요 ❣️
728x90
반응형
'에러 해결 모음집' 카테고리의 다른 글
| [파이썬 에러] AttributeError: module 'ffmpeg' has no attribute 'input' (0) | 2025.09.05 |
|---|---|
| [파이썬 에러] Autogluon 설치 오류 해결 pip install autogluon (0) | 2025.06.12 |
| [파이썬 에러] name '_C' is not defined (0) | 2025.02.10 |
| [OpenCV 에러] cv2.imwrite() 검정색 이미지로만 저장되는 현상 해결 (6) | 2025.02.05 |
| [파이썬 에러] TypeError: read() got an unexpected keyword argument 'ignoregamma’ (1) | 2025.02.05 |
