AttributeError: module 'xxx' has no attribute 'xxx'

CODEDRAGON Development/Python

반응형


 

 

오류 메시지

AttributeError: module 'scipy' has no attribute 'misc'

 

 

 

 

해결 방법

하위패키지 모듈을 직접 import 사용하시기 바랍니다.

 

pydev Error

 

jupyter OK

import scipy as sp

 

img_gray = sp.misc.face(gray=True)

img_gray.shape

  

pydev Error

 

jupyter OK

import scipy

 

img_gray = scipy.misc.face(gray=True)

img_gray.shape

pydev OK

 

jupyter OK

import scipy.misc

 

img_gray = scipy.misc.face(gray=True)

print(img_gray.shape)

# (768, 1024)

 

 


반응형

'Development > Python' 카테고리의 다른 글

클래스 정의  (0) 2019.11.17
dtype  (0) 2019.11.15
4.Summary - 4.데이터베이스 활용  (0) 2019.11.14
2002년 한일월드컵 기간의 기온 공공데이터 가져오기  (0) 2019.11.14
행/열 합계 - sum()  (0) 2019.11.13