IndentationError: unexpected indent error

后端 未结 6 1833
太阳男子
太阳男子 2020-12-10 01:49

I am new to Python and am getting this error:

Traceback (most recent call last):
  File \"/usr/local/bin/scrapy\", line 4, in 
    execute()
           


        
6条回答
  •  一个人的身影
    2020-12-10 01:53

    While the indentation errors are obvious in the StackOverflow page, they may not be in your editor. You have a mix of different indentation types here, 1, 4 and 8 spaces. You should always use four spaces for indentation, as per PEP8. You should also avoid mixing tabs and spaces.

    I also recommend that you try to run your script using the '-tt' command-line option to determine when you accidentally mix tabs and spaces. Of course any decent editor will be able to highlight tabs versus spaces (such as Vim's 'list' option).

提交回复
热议问题