ocropus-archive / DUP-ocropy

Python-based tools for document analysis and OCR
Apache License 2.0
3.41k stars 590 forks source link

Unable to import ocrolib for windows 32 bit #272

Closed kaushikacharya closed 6 years ago

kaushikacharya commented 6 years ago

Current Behavior

I am using anaconda package of python in Windows 7 on a 64 bit machine. With 64 bit python 2.7(anaconda) its working fine. For spell correction, I am using pyenchant library. But since its pip/wheel package is only available for 32 bit, Hence I was trying to run ocropy on 32 bit (python 2.7). This gives the following error:

>>> import ocrolib
  File "C:\Anaconda2_32bit\lib\site-packages\ocrolib\__init__.py", line 12, in <module>
    from common import *
  File "C:\Anaconda2_32bit\lib\site-packages\ocrolib\common.py", line 35, in <module>
    import lstm
  File "C:\Anaconda2_32bit\lib\site-packages\ocrolib\lstm.py", line 38, in <module>
    import nutils
  File "C:\Anaconda2_32bit\lib\site-packages\ocrolib\nutils.py", line 25, in <module>
    lstm_native = compile_and_load(lstm_utils)
  File "C:\Anaconda2_32bit\lib\site-packages\ocrolib\native.py", line 70, in compile_and_load
    return ctypes.CDLL(path)
  File "C:\Anaconda2_32bit\lib\ctypes\__init__.py", line 366, in __init__
    self._handle = _dlopen(self._name, mode)
WindowsError: [Error 193] %1 is not a valid Win32 application

Am I doing anything wrong or is it that ocropy doesn't work for 32 bit windows?

Environment

zuphilip commented 6 years ago

Can you update your ocropy version to the current master and try again? In a recent commit we get rid of the native code and the import nutils.py statement, which seems to give you some error.

kaushikacharya commented 6 years ago

@zuphilip It seems to be working now after the update. Closing the issue. Thanks and Regards