코딩 공부

most likely due to a circular import

DE 군고구마 2021. 7. 14. 14:12
반응형

안녕하세요.

오늘 코딩을 하다가 갑자기 다음과 같은 오류가 발생하면서 무엇인지 찾아보고 해결하여 글을 올립니다.

 

 

🤔 오류 내용

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

 

이게 뭐지? 하고 여기저기 찾아봤는데요. 

다음의 사이트에서 해결 방법을 찾았습니다.

https://geektechstuff.com/2020/06/13/attributeerror-partially-initialized-module-has-no-attribute-python/

 

AttributeError: partially initialized module has no attribute…(Python)

Less of a blog post and more of a reminder to myself that when Python says: AttributeError: partially initialized module ‘MODULE_NAME’ has no attribute ‘ATTRIBUTE_NAME’ (mos…

geektechstuff.com

 

😚 해결 방법

혹시 python을 실행하는 폴더의 파일명과 라이브러리의 명이 똑같지 않으신가요? 저 같은 경우 테스트 하기 위해서 import threading 과정에서 이 파일의 명칭을 똑같이 threading 하였다가 발생했습니다.

 

threading 불러오기

 

현재 실행 하는 폴더에 라이브러리 명과 파일명이 같은지 확인해 주세요.

그리고 라이브러리명을 피해서 파일명을 지정하는 것을 권장드립니다.

 

감사합니다.

반응형