-
[SQLAlchemy] declarative_base() function is now available as sqlalchemy.orm.declarative_base(). 경고 해결Memo/Python 2024. 2. 19. 17:32
⚠️ 문제
Python 프로젝트를 실행하는 과정에서 아래와 같은 SQLAlchemy 경고 문구가 발생하였다.
MovedIn20Warning:
The ``declarative_base()`` function is now available as sqlalchemy.orm.declarative_base(). (deprecated since: 2.0) (Background on SQLAlchemy 2.0 at: https://sqlalche.me/e/b8d9)💡 원인
'declarative_base' 함수를 import 하는 과정에서 이전 방식을 사용하여 발생한 문제였다.
✅ 해결
아래와 같이 import문을 수정해 해결할 수 있었다.
from sqlalchemy.ext.declarative import declarative_base # 기존 코드 # to from sqlalchemy.orm import declarative_base # 새로운 코드
🔗 참고 자료
declarative_base functions have been move by jmnguye · Pull Request #10091 · tiangolo/fastapi
declarative_base functions have been move The declarative_base() function is now available as sqlalchemy.orm.declarative_base(). (deprecated since: 2.0) (Background on SQLAlchemy 2.0 at: https://sq...
github.com
'Memo > Python' 카테고리의 다른 글
[Selenium] Captcha 이미지 저장. 요소 캡쳐 저장하기 (0) 2024.07.06 [Selenium] 요소를 찾지 못하는 경우, frame 안의 요소 가져오기 (0) 2024.03.04 [Python] 'utf-8' codec can't decode byte 0xbe 에러 해결 (0) 2023.02.17 [Python] 텔레그램 API로 메시지 전송 방법 (마크다운, 이모지, 버튼) (0) 2023.02.13 [Django] 템플릿(html)에서 파이썬 enumerate 사용 (0) 2023.01.30