(base) C:\Users\Ohvshiy>activate OCR
(OCR) C:\Users\Ohvshiy>pip install tesseract-ocr
Collecting tesseract-ocr
Using cached tesseract-ocr-0.0.1.tar.gz (33 kB)
Collecting cython
Downloading Cython-0.29.15-cp36-cp36m-win_amd64.whl (1.7 MB)
|████████████████████████████████| 1.7 MB 595 kB/s
Building wheels for collected packages: tesseract-ocr
Building wheel for tesseract-ocr (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: 'C:\Users\Ohvshiy\Anaconda3\envs\OCR\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Ohvshiy\\AppData\\Local\\Temp\\pip-install-sq7_3gh1\\tesseract-ocr\\setup.py'"'"'; __file__='"'"'C:\\Users\\Ohvshiy\\AppData\\Local\\Temp\\pip-install-sq7_3gh1\\tesseract-ocr\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d 'C:\Users\Ohvshiy\AppData\Local\Temp\pip-wheel-upn8j1lf'
cwd: C:\Users\Ohvshiy\AppData\Local\Temp\pip-install-sq7_3gh1\tesseract-ocr\
Complete output (14 lines):
running bdist_wheel
running build
running build_py
file tesseract_ocr.py (for module tesseract_ocr) not found
file tesseract_ocr.py (for module tesseract_ocr) not found
running build_ext
building 'tesseract_ocr' extension
creating build
creating build\temp.win-amd64-3.6
creating build\temp.win-amd64-3.6\Release
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -IC:\Users\Ohvshiy\Anaconda3\envs\OCR\include -IC:\Users\Ohvshiy\Anaconda3\envs\OCR\include "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\winrt" /EHsc /Tptesseract_ocr.cpp /Fobuild\temp.win-amd64-3.6\Release\tesseract_ocr.obj
tesseract_ocr.cpp
tesseract_ocr.cpp(264): fatal error C1083: Cannot open include file: 'leptonica/allheaders.h': No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\x86_amd64\\cl.exe' failed with exit status 2
----------------------------------------
ERROR: Failed building wheel for tesseract-ocr
Running setup.py clean for tesseract-ocr
Failed to build tesseract-ocr
Installing collected packages: cython, tesseract-ocr
Running setup.py install for tesseract-ocr ... error
ERROR: Command errored out with exit status 1:
command: 'C:\Users\Ohvshiy\Anaconda3\envs\OCR\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Ohvshiy\\AppData\\Local\\Temp\\pip-install-sq7_3gh1\\tesseract-ocr\\setup.py'"'"'; __file__='"'"'C:\\Users\\Ohvshiy\\AppData\\Local\\Temp\\pip-install-sq7_3gh1\\tesseract-ocr\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\Ohvshiy\AppData\Local\Temp\pip-record-99igt6e4\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\Ohvshiy\Anaconda3\envs\OCR\Include\tesseract-ocr'
cwd: C:\Users\Ohvshiy\AppData\Local\Temp\pip-install-sq7_3gh1\tesseract-ocr\
Complete output (18 lines):
Compiling tesseract_ocr.pyx because it depends on C:\Users\Ohvshiy\Anaconda3\envs\OCR\lib\site-packages\Cython\Includes\libc\string.pxd.
[1/1] Cythonizing tesseract_ocr.pyx
C:\Users\Ohvshiy\Anaconda3\envs\OCR\lib\site-packages\Cython\Compiler\Main.py:369: FutureWarning: Cython directive 'language_level' not set, using 2 for now (Py2). This will change in a later release! File: C:\Users\Ohvshiy\AppData\Local\Temp\pip-install-sq7_3gh1\tesseract-ocr\tesseract_ocr.pyx
tree = Parsing.p_module(s, pxd, full_module_name)
running install
running build
running build_py
file tesseract_ocr.py (for module tesseract_ocr) not found
file tesseract_ocr.py (for module tesseract_ocr) not found
running build_ext
building 'tesseract_ocr' extension
creating build
creating build\temp.win-amd64-3.6
creating build\temp.win-amd64-3.6\Release
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -IC:\Users\Ohvshiy\Anaconda3\envs\OCR\include -IC:\Users\Ohvshiy\Anaconda3\envs\OCR\include "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\winrt" /EHsc /Tptesseract_ocr.cpp /Fobuild\temp.win-amd64-3.6\Release\tesseract_ocr.obj
tesseract_ocr.cpp
tesseract_ocr.cpp(631): fatal error C1083: Cannot open include file: 'leptonica/allheaders.h': No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\x86_amd64\\cl.exe' failed with exit status 2
----------------------------------------
ERROR: Command errored out with exit status 1: 'C:\Users\Ohvshiy\Anaconda3\envs\OCR\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Ohvshiy\\AppData\\Local\\Temp\\pip-install-sq7_3gh1\\tesseract-ocr\\setup.py'"'"'; __file__='"'"'C:\\Users\\Ohvshiy\\AppData\\Local\\Temp\\pip-install-sq7_3gh1\\tesseract-ocr\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\Ohvshiy\AppData\Local\Temp\pip-record-99igt6e4\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\Ohvshiy\Anaconda3\envs\OCR\Include\tesseract-ocr' Check the logs for full command output.
from PIL import Image
import pytesseract
pytesseract.pytesseract.tesseract_cmd = r'C:\Users\Violet\AppData\Local\Tesseract-OCR\tesseract.exe'
print(pytesseract.image_to_string(Image.open(r'img\driver_fr\777.jpg'), lang="rus"))