전체 방문자
오늘
어제
  • 전체 글
    • HTML
    • CSS
    • Javascript
    • React
    • Typescript
    • Next.js
    • Webpack
    • Vue.js
    • Git & GitHub
    • Error
    • Study
    • 개발 일지✨

블로그 메뉴

  • 💡
  • ⚙️
hELLO · Designed By 정상우.
하루

Home

IndentationError: expected an indented block 오류 해결 방법
Error

IndentationError: expected an indented block 오류 해결 방법

2022. 3. 8. 18:52

IndentationError: expected an indented block 오류 해결 방법

원인

IndentationError 는 코드에서 들여쓰기 할 때 탭과 스페이스를 섞어서 사용하게 되면 발생하게 된다.

 

해결

오류가 발생한 줄의 코드의 들여쓰기 부분을 지웠다가 다시 작성해주면 된다.

오류가 발생한 줄은 빨간색으로 된 오류출력 코드의 끝에 File "~~~", line 13 ^ 으로 된 곳을 보면 된다.

위의 예시에서는 코드의 13번째 줄에서 오류가 난 것을 확인할 수 있다.

    'Error' 카테고리의 다른 글
    • [Pycharm] 특정 파일이 다른 확장자로 인식되는 경우
    • [MongoDB] MongoDB application is only supported on Windows 10/Windows 2016 or later 해결 방법
    • Error: [Errno 48] Address already in use 오류 해결 방법
    • UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc0 in position 0: invalid start byte 오류 해결 방법

    티스토리툴바