AttributeError: module 'collections' has no attribute 'Callable' ์๋ฌ ์ฒ๋ฆฌ ๋ฐฉ๋ฒ
์ ๊ฐ์ฌ๋์ด ๋ค๋ฅธ ์ง๋ฌธ์ ๋ต๋ณํด์ฃผ์ ๊ฑฐ ๋ณด๊ณ ํด๊ฒฐํ์ต๋๋ค!! ๊ฐ์ฌํฉ๋๋ค. ์๋
ํ์ธ์. ํ์ฌ ํ์ด์ฌ 3.10์ ์ฐ๊ณ ๊ณ์๋ ๋ฐ์. django-pydenticon ๋ด์์ ์ฌ์ฉ๋๋ collections.Callable ์ฐธ์กฐ๊ฐ ํ์ด์ฌ 3.10๋ถํฐ collections.abc.Callable๋ก ์ด๋ํ์ฌ, ์ ๊ฑฐ๋ Attribute๋ผ์ ๋ฐ์ํ๋ ์ค๋ฅ์
๋๋ค. ํ์ด์ฌ 3.9์์ collections.Callable์ ์ฐธ์กฐํ๋ฉด ์๋์ ๊ฒฝ๊ณ ๊ฐ ๋น๋๋ค. :1: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated since Python 3.3, and in 3.10 it will stop working django-pydenticon์ด ํ์ด์ฌ 3.10์ ์ง์ํด์ผ ํด๊ฒฐ์ด ๋๋ ์ด์์ธ๋ฐ์. ํ์ด์ฌ ๋ฒ์ ์ 3.9๋ก ๋ด๋ ค์ ์คํ์ ํด๋ณด์ค์๋ ์๊ตฌ์. ํน์ ๋ชฝํคํจ์นญ์ด์ง๋ง, ํ๋ก์ ํธ์ settings.py ์๋จ์ ๋ค์์ ์ถ๊ฐํ์์ด, ์์์ ์ผ๋ก collections.Callable ์์ฑ์ collections.abc.Callable ๋ก๋ถํฐ ๋ณต์ฌํ์๋ ๋ฐฉ๋ฒ๋ ์๊ธด ํฉ๋๋ค. import collectionsif not hasattr(collections, 'Callable'): collections.Callable = collections.abc.Callable ํ์ดํ
์
๋๋ค. :-)