개발, 전산, AI, IT
[파이썬] module 'numpy' has no attribute
크롬망간
2023. 11. 17. 21:31
분명 numpy를 설치했는데 파이썬에서 numpy를 사용하려 하면 다음과 같이 AttributeError: module 'numpy' has no attribute ... 하는 에러가 뜰 때가 있습니다.
import numpy as np
print(np.__version__)
# AttributeError: module 'numpy' has no attribute '__version__'
이는 numpy가 설치는 되었지만 시스템에서 파이썬 라이브러리로 제대로 연결이 안 되어서 그렇습니다. 이럴 경우 맥에서 homebrew를 사용할 때를 기준으로
brew link --overwrite numpy
를 실행해주면 문제가 해결됩니다.
참조한 곳: https://github.com/Homebrew/homebrew-core/issues/15698#issuecomment-315730732