OSError:.pynative / ...:文件太短

时间:2016-10-12 22:59:54

标签: python

当我尝试将OCRopus(基于python的OCR工具)应用于TIFF图像时,我收到以下python错误:

    Traceback (most recent call last):
  File "/usr/local/bin/ocropus-nlbin", line 10, in <module>
    import ocrolib
  File "/usr/local/lib/python2.7/dist-packages/ocrolib/__init__.py", line 12, in <module>
    from common import *
  File "/usr/local/lib/python2.7/dist-packages/ocrolib/common.py", line 18, in <module>
    import lstm
  File "/usr/local/lib/python2.7/dist-packages/ocrolib/lstm.py", line 32, in <module>
    import nutils
  File "/usr/local/lib/python2.7/dist-packages/ocrolib/nutils.py", line 25, in <module>
    lstm_native = compile_and_load(lstm_utils)
  File "/usr/local/lib/python2.7/dist-packages/ocrolib/native.py", line 68, in compile_and_load
    return ctypes.CDLL(path)
  File "/usr/lib/python2.7/ctypes/__init__.py", line 365, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: .pynative/cccd32009099f8dade0fe6cd205bf188.so: file too short
Traceback (most recent call last):
  File "/usr/local/bin/ocropus-gpageseg", line 22, in <module>
    import ocrolib
  File "/usr/local/lib/python2.7/dist-packages/ocrolib/__init__.py", line 12, in <module>
    from common import *
  File "/usr/local/lib/python2.7/dist-packages/ocrolib/common.py", line 18, in <module>
    import lstm
  File "/usr/local/lib/python2.7/dist-packages/ocrolib/lstm.py", line 32, in <module>
    import nutils
  File "/usr/local/lib/python2.7/dist-packages/ocrolib/nutils.py", line 25, in <module>
    lstm_native = compile_and_load(lstm_utils)
  File "/usr/local/lib/python2.7/dist-packages/ocrolib/native.py", line 68, in compile_and_load
    return ctypes.CDLL(path)
  File "/usr/lib/python2.7/ctypes/__init__.py", line 365, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: .pynative/cccd32009099f8dade0fe6cd205bf188.so: file too short
Traceback (most recent call last):
  File "/usr/local/bin/ocropus-rpred", line 7, in <module>
    import ocrolib
  File "/usr/local/lib/python2.7/dist-packages/ocrolib/__init__.py", line 12, in <module>
    from common import *
  File "/usr/local/lib/python2.7/dist-packages/ocrolib/common.py", line 18, in <module>
    import lstm
  File "/usr/local/lib/python2.7/dist-packages/ocrolib/lstm.py", line 32, in <module>
    import nutils
  File "/usr/local/lib/python2.7/dist-packages/ocrolib/nutils.py", line 25, in <module>
    lstm_native = compile_and_load(lstm_utils)
  File "/usr/local/lib/python2.7/dist-packages/ocrolib/native.py", line 68, in compile_and_load
    return ctypes.CDLL(path)
  File "/usr/lib/python2.7/ctypes/__init__.py", line 365, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: .pynative/cccd32009099f8dade0fe6cd205bf188.so: file too short
Traceback (most recent call last):
  File "/usr/local/bin/ocropus-hocr", line 8, in <module>
    import ocrolib
  File "/usr/local/lib/python2.7/dist-packages/ocrolib/__init__.py", line 12, in <module>
    from common import *
  File "/usr/local/lib/python2.7/dist-packages/ocrolib/common.py", line 18, in <module>
    import lstm
  File "/usr/local/lib/python2.7/dist-packages/ocrolib/lstm.py", line 32, in <module>
    import nutils
  File "/usr/local/lib/python2.7/dist-packages/ocrolib/nutils.py", line 25, in <module>
    lstm_native = compile_and_load(lstm_utils)
  File "/usr/local/lib/python2.7/dist-packages/ocrolib/native.py", line 68, in compile_and_load
    return ctypes.CDLL(path)
  File "/usr/lib/python2.7/ctypes/__init__.py", line 365, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: .pynative/cccd32009099f8dade0fe6cd205bf188.so: file too short

由于这是python问题,我还没有标记OCROpus,我也应该标记它吗? 它可能是Python安装问题吗?如果是这样,我该如何解决?

1 个答案:

答案 0 :(得分:1)

问题解决了。 我看到其他人遇到麻烦(在不同的问题上):

  

OSError: [X] ...:文件太短

我的建议是:无论你做什么,检查当前目录中名为[X]的隐藏目录并删除它们。