Python错误集

1--》IndentationError:expected an indented block

   》IndentationError: unindent does not match any outer indentation level

  》IndentationError: unexpected indent

  报错的地方需要缩进,在出现错误的那一行,按空格或Tab(但不能混用)键缩进就行。最好都用Tab,简单些,本来打算全部用四个空格的,结果写完了,一执行到处都报错

2--》(unicode error) 'utf-8' codec can't decode

  需要将保存文件的格式换成UTF-8,在notepad++打开test.py >> (菜单栏)格式(编码)>> 选择转为UTF-8格式(Convert to UTF-8)

3--》UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-61:

     

1 import sys
2 reload(sys)
3 sys.setdefaultencoding('utf-8')

 在使用 pytesseract中的image_to_string时报错如下:

在C:\Python27\Lib\site-packages\pytesseract下找到pytesseract.py,打开后,做如下修改

 

 

 

posted on 2016-12-15 10:12  小唐师叔  阅读(287)  评论(0编辑  收藏  举报