Skip to content
Home » Solving “inconsistent use of tabs and spaces in indentation” in Visual Studio Code

Solving “inconsistent use of tabs and spaces in indentation” in Visual Studio Code

Out of the blue, when coding Python in Visual Studio Code, you might run into the following error.

“inconsistent use of tabs and spaces in indentation”

This happens, because somewhere in your code, indentation is different than in the rest of your code. Generally, Python doesn’t care what kind of indentation your editor uses, whether it be some spaces, or tabs. But it expects you to be consistent.

Generally, VS Code is pretty good at guessing the kind of indentation is used in the file you’re working in. If you press control + , and scroll down to this setting, you can choose if you want VS Code to detect the kind of indentation in a particular file.

Furthermore, you can get to that same preference and also choose what kind of indentation you want by clicking on the ‘Tab Size: X’ in the bottom right corner of your IDE.

Finally, if you run into the error, and you want to get rid of the spaces (or vice versa), you can paste your code in Notepad++, and do a search and replace by pressing control + H. In the following screenshot I search for 4 spaces and I replace with a tab by entering \t.

Great success!

Say thanks, ask questions or give feedback

Technologies get updated, syntax changes and honestly… I make mistakes too. If something is incorrect, incomplete or doesn’t work, let me know in the comments below and help thousands of visitors.

61 thoughts on “Solving “inconsistent use of tabs and spaces in indentation” in Visual Studio Code”

  1. Pingback: Inconsistent Use of Tabs and Spaces in Indentation

  2. Pingback: URL

  3. Pingback: b4R

  4. Pingback: benzodiazepine kopen

  5. Pingback: buy browning shotguns

  6. Pingback: upx1688.online

  7. Pingback: สล็อตวอเลท

  8. Pingback: สล็อตเว็บตรง

  9. Pingback: จดทะเบียน อย

  10. Pingback: รับทำเว็บไซต์บริษัท

  11. Pingback: เพิ่มติดตาม

  12. Pingback: ai ดูดวง

  13. Pingback: Skrotning bil Partille

  14. Pingback: ks quik 2000

  15. Pingback: แผ่นซับเสียง

  16. Pingback: Webb.org

  17. Pingback: สล็อตค่ายใหญ่

  18. Pingback: จำนองบ้าน

  19. Pingback: ข่าวบอล

  20. Pingback: plumbers woodstock ga

  21. Pingback: ทะเบียนรถ

  22. Pingback: สล็อตเว็บตรง

  23. Pingback: รับติดตั้งโซล่าเซลล์

  24. Pingback: เครื่องพ่นหมอกควัน

  25. Pingback: clique aqui

  26. Pingback: ไส้เทียมคอลลาเจน

  27. Pingback: คายัค

  28. Pingback: Stenungsunds bildemontering

  29. Pingback: Exology

  30. Pingback: ยาเพิ่มขนาด

  31. Pingback: 해외선물 솔루션 분양

  32. Pingback: אחסון אתרים מחיר

  33. Pingback: ตรวจดาวน์ซินโดรม

  34. Pingback: ติดตั้ง ais fiber

  35. Pingback: slot gacor hari ini

  36. Pingback: ลวดสลิง

  37. Pingback: 外贸建站公司

  38. Pingback: White Label Payment Services

  39. Pingback: สล็อต เครดิตฟรี

  40. Pingback: cric hd

  41. Pingback: hostel bangkok

  42. Pingback: psychotherapy san diego

  43. Pingback: ส่งพัสดุ

  44. Pingback: Morpheus8 รีวิว

  45. Pingback: Buy CMMG DEFCAN 3 TI  Online

  46. Pingback: แทงบอล

  47. Pingback: pg slot เว็บตรง

  48. Pingback: catzilla crypto

  49. Pingback: ตู้เชื่อม

  50. Pingback: โป๊กเกอร์

  51. Pingback: ต่อผม

  52. Pingback: ufa191

  53. Pingback: pg333

  54. Pingback: พอต ราคาส่ง

  55. Pingback: จอ led ขนาดใหญ่

  56. Pingback: คาสิโนออนไลน์ sagame

  57. Pingback: Herbalife

  58. Pingback: Scuba diving koh tao

  59. Pingback: omg

  60. Pingback: สติ๊กเกอร์ไดคัท

Leave a Reply

Your email address will not be published. Required fields are marked *