Python Image Recognition錯誤2

來源:互聯網
上載者:User

標籤:原理   date   轉義   top   識別   sage   路徑   site   src   

發生了 WindowsError
Message=[Error 2]
StackTrace:
Popen._execute_child 中的 C:\Python27amd64\lib\subprocess.py:640
Popen.__init__ 中的 C:\Python27amd64\lib\subprocess.py:390
run_tesseract 中的 C:\Python27amd64\lib\site-packages\pytesseract\pytesseract.py:47
image_to_string 中的 C:\Python27amd64\lib\site-packages\pytesseract\pytesseract.py:123
GetImageDate.m 中的 C:\Users\Yu-we\Desktop\projects\ToolsSuite\PythonDataCatcher\ImageIdentification.py:9

 

按教程下載配置Path

pytesseract PIL

及安裝 Tesseract-OCR

出現以上錯誤。。

原因:啟動子進程時找不到程式檔案。檢查之下,是路徑問題。路徑寫得沒有問題,但就是不對。前面加個 r

解決。

加 r 是什麼意思?

 

引:

在開啟檔案的時候open(r‘c:\....‘)

加r和不加‘‘r是有區別的

‘r‘是防止字元轉義的 如果路徑中出現‘\t‘的話 不加r的話\t就會被轉義 而加了‘r‘之後‘\t‘就能保留原有的樣子 

在字串賦值的時候 前面加‘r‘可以防止字串在時候的時候不被轉義 原理是在逸出字元前加‘\‘

 

 

Python Image Recognition錯誤2

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.