pip, PyCharm install tesserocr error solution
When crawling, you may encounter verification code verification, you can use the tesserocr library to identify the verification code. But there are various errors when installing tesserocr. such as pip install
pip install tesserocr or pip install tesserocr
Errors will appear, and there are many errors, such as python setup.py egg_info did not run successfully.
note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed and many other error messages.
Even if tesseract is installed according to the articles of other bloggers, and the corresponding whl file, it still reports an error. Using pycharm to directly search and install the tesserocr installation package also reported an error. Clicking on the details of the installation failure is similar to that of the pip installation failure.
I also found a lot of articles to find solutions to the problem. Later, when pycharm tried to install tesserocr again, I found the pytesseract installation package. After the query, I found that pytesseract can also recognize the verification code, which is an installation package provided by chrome. I try to use pytsseract
- import pytesseract
- from PIL import Image
-
- image = Image.open('D:\image.png.png')
- print(pytesseract.image_to_string(image))
Recognized pictures
The result is as follows
It can be seen that the recognition is successful. If you feel that installing tesserocr makes your blood pressure rise, it is better to directly
pip install pytesseract or use pycharm to directly search for pytesseract installation, it will be done in two seconds.
pycharm install pytesseract------>files------->settings
Want to learn more about pytesseract