Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Trouble installing tesseract

Having an issue installing tesseract, looked through google and stackoverflow. Still confused.

here is the outcome from CMD when running this: npm install -tesseract

C:\Program Files (x86)\Microsoft Visual Studio\Installer\resources\app>npm install tesseract

> [email protected] install C:\Program Files (x86)\Microsoft Visual Studio\Installer\resources\app\node_modules\tesseract
> node-gyp rebuild


C:\Program Files (x86)\Microsoft Visual Studio\Installer\resources\app\node_modules\tesseract>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild )
gyp ERR! configure error
gyp ERR! stack Error: Command failed: C:\Program Files (x86)\Python37-32\python.EXE -c import sys; print "%s.%s.%s" % sys.version_info[:3];
gyp ERR! stack   File "<string>", line 1
gyp ERR! stack     import sys; print "%s.%s.%s" % sys.version_info[:3];
gyp ERR! stack                                ^
gyp ERR! stack SyntaxError: invalid syntax
gyp ERR! stack
gyp ERR! stack     at ChildProcess.exithandler (child_process.js:294:12)
gyp ERR! stack     at ChildProcess.emit (events.js:189:13)
gyp ERR! stack     at maybeClose (internal/child_process.js:970:16)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
gyp ERR! System Windows_NT 10.0.17763
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Program Files (x86)\Microsoft Visual Studio\Installer\resources\app\node_modules\tesseract
gyp ERR! node -v v10.15.3
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
npm WARN [email protected] No repository field.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Eduards\AppData\Roaming\npm-cache\_logs\2019-09-09T16_44_44_751Z-debug.log

C:\Program Files (x86)\Microsoft Visual Studio\Installer\resources\app>

can somebody direct me please? I have install Python via administrator into c drive and into program files(64). node modules are not in the python file.


1 Answers

Are you intending to install the library or the Python bindings?

The library installation on Windows:

Installer for Windows for Tesseract 3.05 and Tesseract 4 are available from Tesseract at UB Mannheim. These include the training tools. Both 32-bit and 64-bit installers are available.

An installer for the OLD version 3.02 is available for Windows from our download page. This includes the English training data. If you want to use another language, download the appropriate training data, unpack it using 7-zip, and copy the .traineddata file into the 'tessdata' directory, probably C:\Program Files\Tesseract-OCR\tessdata.

Whereas the tesseract bindings for Python are installable via pip from command line:

pip install pytesseract

npm is not a Python package manager so it indeed is failing for tesseract install.

like image 153
sophros Avatar answered Jun 17 '26 10:06

sophros



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!