본문 바로가기
coding 📟/error 💣

[ERROR] AttributeError: Can’t get attribute ‘new_block’ on <module ‘pandas.core.internals.blocks’

by 고돌한 데이터 사이언스 2022. 3. 8.
반응형

error 상황


    with open(./pickle/df_train.pickle','rb') as fr:
        df_train = pickle.load(fr)

해당 코드를 통해 다른 서버에서 생성한 pickle 파일을 읽어 오려했다.

 

error 메시지


attributeerror: can't get attribute 'new_block' on <module 'pandas.core.internals.blocks'

 

error 원인


pickle 파일을 생성한 가상 환경의 pandas 버전과,

pickle 파일을 읽어오려 하는 가상환경의 pandas 버전이 맞지 않아 충돌로 인해 발생하는 에러.

 

error 해결법


pickle 파일을 생성한 가상환경 pandas 버전 확인 명령어

!pip list | grep pandas

출력 : pandas 1.3.5

 

pickle 파일을 읽어오려는 가상환경 pandas 버전도 해당 버전으로 맞춰준다

 

!pip install pandas==1.3.5

 

🎥고돌한고돌이 youtube

https://www.youtube.com/channel/UCJqvLr-GzRouSGiT235bMuw

 

고돌한고돌이 KODORRI

하고싶은거 많은 고돌이의 먹부림 일상

www.youtube.com

 

반응형

댓글