Install python reptile --- tesserocr library

Summer vacation the next day, opened the way of reptiles, later found to be much better with the environment, a relatively smooth start, but even today, it took more than four hours with tesserocr library, one of the frustrations, hardships and really hard to say, ado, directly on the hard goods.
Before installing tesserocr library of course, you must be installed tesseracr you, here it is a simple matter careful not to speak it.
The following error occurred during the initial installation:

Exception:
Traceback (most recent call last):
  File "C:\Users\upup\AppData\Local\conda\conda\envs\http\lib\site-packages\pip\compat\__init__.py", line 73, in console_to_str
    return s.decode(sys.__stdout__.encoding)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xd5 in position 70: invalid continuation byte

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\upup\AppData\Local\conda\conda\envs\http\lib\site-packages\pip\commands\install.py", line 335, in run
    wb.build(autobuilding=True)
  File "C:\Users\upup\AppData\Local\conda\conda\envs\http\lib\site-packages\pip\wheel.py", line 749, in build
    self.requirement_set.prepare_files(self.finder)
  File "C:\Users\upup\AppData\Local\conda\conda\envs\http\lib\site-packages\pip\req\req_set.py", line 380, in prepare_files
    ignore_dependencies=self.ignore_dependencies))
  File "C:\Users\upup\AppData\Local\conda\conda\envs\http\lib\site-packages\pip\req\req_set.py", line 634, in _prepare_file
    abstract_dist.prep_for_dist()
  File "C:\Users\upup\AppData\Local\conda\conda\envs\http\lib\site-packages\pip\req\req_set.py", line 129, in prep_for_dist
    self.req_to_install.run_egg_info()
  File "C:\Users\upup\AppData\Local\conda\conda\envs\http\lib\site-packages\pip\req\req_install.py", line 439, in run_egg_info
    command_desc='python setup.py egg_info')
  File "C:\Users\upup\AppData\Local\conda\conda\envs\http\lib\site-packages\pip\utils\__init__.py", line 676, in call_subprocess
    line = console_to_str(proc.stdout.readline())
  File "C:\Users\upup\AppData\Local\conda\conda\envs\http\lib\site-packages\pip\compat\__init__.py", line 75, in console_to_str
    return s.decode('utf_8')
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xd5 in position 70: invalid continuation byte

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\upup\AppData\Local\conda\conda\envs\http\lib\site-packages\pip\basecommand.py", line 215, in main
    status = self.run(options, args)
  File "C:\Users\upup\AppData\Local\conda\conda\envs\http\lib\site-packages\pip\commands\install.py", line 385, in run
    requirement_set.cleanup_files()
  File "C:\Users\upup\AppData\Local\conda\conda\envs\http\lib\site-packages\pip\utils\build.py", line 38, in __exit__
    self.cleanup()
  File "C:\Users\upup\AppData\Local\conda\conda\envs\http\lib\site-packages\pip\utils\build.py", line 42, in cleanup
    rmtree(self.name)
  File "C:\Users\upup\AppData\Local\conda\conda\envs\http\lib\site-packages\pip\_vendor\retrying.py", line 49, in wrapped_f
    return Retrying(*dargs, **dkw).call(f, *args, **kw)
  File "C:\Users\upup\AppData\Local\conda\conda\envs\http\lib\site-packages\pip\_vendor\retrying.py", line 212, in call
    raise attempt.get()
  File "C:\Users\upup\AppData\Local\conda\conda\envs\http\lib\site-packages\pip\_vendor\retrying.py", line 247, in get
    six.reraise(self.value[0], self.value[1], self.value[2])
  File "C:\Users\upup\AppData\Local\conda\conda\envs\http\lib\site-packages\pip\_vendor\six.py", line 686, in reraise
    raise value
  File "C:\Users\upup\AppData\Local\conda\conda\envs\http\lib\site-packages\pip\_vendor\retrying.py", line 200, in call
    attempt = Attempt(fn(*args, **kwargs), attempt_number, False)
  File "C:\Users\upup\AppData\Local\conda\conda\envs\http\lib\site-packages\pip\utils\__init__.py", line 102, in rmtree
    onerror=rmtree_errorhandler)
  File "C:\Users\upup\AppData\Local\conda\conda\envs\http\lib\shutil.py", line 494, in rmtree
    return _rmtree_unsafe(path, onerror)
  File "C:\Users\upup\AppData\Local\conda\conda\envs\http\lib\shutil.py", line 384, in _rmtree_unsafe
    _rmtree_unsafe(fullname, onerror)
  File "C:\Users\upup\AppData\Local\conda\conda\envs\http\lib\shutil.py", line 393, in _rmtree_unsafe
    onerror(os.rmdir, path, sys.exc_info())
  File "C:\Users\upup\AppData\Local\conda\conda\envs\http\lib\site-packages\pip\utils\__init__.py", line 114, in rmtree_errorhandler
    func(path)
PermissionError: [WinError 32] 另一个程序正在使用此文件,进程无法访问。: 'C:\\Users\\upup\\AppData\\Local\\Temp\\pip-build-fixlbed7\\tesserocr'

Solution to: modify the source code pip

在"C:\Users\upup\AppData\Local\conda\conda\envs\http\lib\site-packages\pip\compat_init_.py"

The first line 75, the return s.decode ( 'utf_8') to return s.decode ( 'cp936') can. Here you do not use Notepad can be used to modify editplus. After the deal is completed the above problems, there was the following questions (really make people very angry wailing)

I was following command to install:

pip3 install tesserocr pillow

But it has been stuck with, as follows:
Here Insert Picture Descriptionthat is stuck in this place, at first thought it was speed, and later the Internet to find a lot of tutorials, to no avail. And there was also the end of an error:
Here Insert Picture DescriptionAfter Baidu, I installed a rpy2-2.9.5-cp36-cp36m-win_amd64.whl, file installation is successful a command will be solved. But it was so bad. Then I will continue to look for tutorials. It can be found using the following command:

pip install tesseract-ocr

Unfortunately, ah, but also wrong:
Here Insert Picture Description
this happens, do not worry to install Microdoft Visual C ++ 14.0, we put it another way First, download the installation file corresponding .whl, must be paired with the tesseract version:
run the command: pip3 install tesserocr -2.2.2-cp36-cp36m-win_amd64.whl (this file I also spend money ....).
After running this command, suddenly successful hhhhhh. Figure:
Here Insert Picture Description
I do not know why, we do not dare to ask.

Guess you like

Origin blog.csdn.net/weixin_43803070/article/details/94396664