강의

멘토링

커뮤니티

인프런 커뮤니티 질문&답변

sykwag7님의 프로필 이미지
sykwag7

작성한 질문수

파이썬 무료 강의 (기본편) - 6시간 뒤면 나도 개발자

pickle

pickle 에러

작성

·

428

2

import pickle
profile_file = open("profile.pickle", "rb")
profile = pickle.load(profile_file) # file에 있는 정보를 profile에 불러오기
print(profile)
profile_file.close()

이 부분에서 에러가 

Traceback (most recent call last):

  File "/Users/terrykwag/Documents/PythonWorkspace/7. 입출력/pickle.py", line 4, in <module>

    import pickle

  File "/Users/terrykwag/Documents/PythonWorkspace/7. 입출력/pickle.py", line 13, in <module>

    profile = pickle.load(profile_file) # file에 있는 정보를 profile에 불러오기

AttributeError: partially initialized module 'pickle' has no attribute 'load' (most likely due to a circular import)

이렇게 뜨는데 왜 안되는걸까요? write는 잘 됐는데 ㅠㅠ

답변 1

2

나도코딩님의 프로필 이미지
나도코딩
지식공유자

아마 pickle.py 로 파일명을 쓰셨을 것 같은데요, pickle_practice.py 와 같은 식으로 바꿔주셔야 해요.

sykwag7님의 프로필 이미지
sykwag7

작성한 질문수

질문하기