개발자 모드

  • 홈
  • 태그
  • 방명록

module 'datetime' has no attribute 'strptime' 1

[Python/파이썬] module 'datetime' has no attribute 'strptime'

평소 잘 돌아가던, 코드에서 갑작스럽게 에러가 터졌다. module 'datetime' has no attribute 'strptime' datetime을 import하고 strptime 함수를 쓰려니 오류가 났다. 오류난 코드는 아래와 같다. import datetime datetime.strptime(~) 찾아보니, datetime을 import datetime으로 했다면 datetime.datetime.strptime()으로 쓰는 것이 맞는 것이다. (datetime 라이브러리를 만든 분이, 이렇게 만드셨다고...!) import datetime datetime.datetime.strptime(~) 이같은 코드가 보기 좋지 않다면 다음과 같이 작성하여 쓸 수 있다. from datetime impo..

Error Record 2023.07.26
이전
1
다음
더보기
프로필사진

안녕하세요

  • 분류 전체보기 (205)
    • CS (116)
      • OS (43)
      • Computer Architecture (20)
      • Algorithm (20)
      • Network (10)
      • DB (23)
    • Project (4)
      • Random Photo Matcher (4)
    • Error Record (16)
    • BOJ (11)
      • BFS DFS (7)
      • BackTracking (2)
      • Recursion (1)
    • Java (9)
    • Spring (3)
    • JPA (8)
    • Python (6)
    • 기타 (20)
    • 모각코 (12)

최근글과 인기글

  • 최근글
  • 인기글


최근댓글



Archives

Calendar

«   2025/05   »
일 월 화 수 목 금 토
1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31

Copyright © Kakao Corp. All rights reserved.

  • GitHub

티스토리툴바