ratazzi / tesseract-ocr

A Python wrapper for Tesseract
MIT License
19 stars 6 forks source link

error in pip install tesseract-ocr #1

Open atulyakumar97 opened 5 years ago

atulyakumar97 commented 5 years ago
(base) C:\Users\Atulya>pip install tesseract-ocr
Collecting tesseract-ocr
  Using cached https://files.pythonhosted.org/packages/e2/0d/dcee3dd0fc4c7bcd18125a98f8ba6d9db7aecaa40770595203e312649587/tesseract-ocr-0.0.1.tar.gz
Requirement already satisfied: cython in c:\users\atulya\anaconda3\lib\site-packages (from tesseract-ocr) (0.29.2)
Building wheels for collected packages: tesseract-ocr
  Running setup.py bdist_wheel for tesseract-ocr ... error
  Complete output from command C:\Users\Atulya\Anaconda3\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\Atulya\\AppData\\Local\\Temp\\pip-install-l8oy0gzl\\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\Atulya\AppData\Local\Temp\pip-wheel-im9esi2k --python-tag cp37:
  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.7
  creating build\temp.win-amd64-3.7\Release
  C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.16.27023\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -IC:\Users\Atulya\Anaconda3\include -IC:\Users\Atulya\Anaconda3\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.16.27023\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\cppwinrt" /EHsc /Tptesseract_ocr.cpp /Fobuild\temp.win-amd64-3.7\Release\tesseract_ocr.obj
  tesseract_ocr.cpp
  tesseract_ocr.cpp(646): fatal error C1083: Cannot open include file: 'leptonica/allheaders.h': No such file or directory
  error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\BuildTools\\VC\\Tools\\MSVC\\14.16.27023\\bin\\HostX86\\x64\\cl.exe' failed with exit status 2

  ----------------------------------------
  Failed building wheel for tesseract-ocr
  Running setup.py clean for tesseract-ocr
Failed to build tesseract-ocr
Installing collected packages: tesseract-ocr
  Running setup.py install for tesseract-ocr ... error
    Complete output from command C:\Users\Atulya\Anaconda3\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\Atulya\\AppData\\Local\\Temp\\pip-install-l8oy0gzl\\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\Atulya\AppData\Local\Temp\pip-record-y3alhreu\install-record.txt --single-version-externally-managed --compile:
    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.7
    creating build\temp.win-amd64-3.7\Release
    C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.16.27023\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -IC:\Users\Atulya\Anaconda3\include -IC:\Users\Atulya\Anaconda3\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.16.27023\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\cppwinrt" /EHsc /Tptesseract_ocr.cpp /Fobuild\temp.win-amd64-3.7\Release\tesseract_ocr.obj
    tesseract_ocr.cpp
    tesseract_ocr.cpp(646): fatal error C1083: Cannot open include file: 'leptonica/allheaders.h': No such file or directory
    error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\BuildTools\\VC\\Tools\\MSVC\\14.16.27023\\bin\\HostX86\\x64\\cl.exe' failed with exit status 2

    ----------------------------------------
Command "C:\Users\Atulya\Anaconda3\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\Atulya\\AppData\\Local\\Temp\\pip-install-l8oy0gzl\\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\Atulya\AppData\Local\Temp\pip-record-y3alhreu\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\Atulya\AppData\Local\Temp\pip-install-l8oy0gzl\tesseract-ocr\
ratazzi commented 5 years ago

Sorry, I'm not a Microsoft Windows user. I don't know how to solve the dependency problem (Cannot open include file: 'leptonica/allheaders.h': No such file or directory). If you can solve and submit the pull request, that will be very helpful.

zackees commented 2 years ago

Just fyi, you could add platform builders so that you know whether your software runs or not on a given platform.

Just create $PROJECT_ROOT/.github/workflows/test_win.yml Like https://raw.githubusercontent.com/zackees/open-webdriver/main/.github/workflows/test_win.yml

Then add in the badges to your readme: https://github.com/zackees/open-webdriver/