OSError: .pynative/... : file too short
<p>When I try to apply OCRopus (a python-based OCR tool) to a TIFF image, I get the following python error:</p>

<pre><code>    Traceback (most recent call last):
  File "/usr/local/bin/ocropus-nlbin", line 10, in &lt;module&gt;
    import ocrolib
  File "/usr/local/lib/python2.7/dist-packages/ocrolib/__init__.py", line 12, in &lt;module&gt;
    from common import *
  File "/usr/local/lib/python2.7/dist-packages/ocrolib/common.py", line 18, in &lt;module&gt;
    import lstm
  File "/usr/local/lib/python2.7/dist-packages/ocrolib/lstm.py", line 32, in &lt;module&gt;
    import nutils
  File "/usr/local/lib/python2.7/dist-packages/ocrolib/nutils.py", line 25, in &lt;module&gt;
    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 &lt;module&gt;
    import ocrolib
  File "/usr/local/lib/python2.7/dist-packages/ocrolib/__init__.py", line 12, in &lt;module&gt;
    from common import *
  File "/usr/local/lib/python2.7/dist-packages/ocrolib/common.py", line 18, in &lt;module&gt;
    import lstm
  File "/usr/local/lib/python2.7/dist-packages/ocrolib/lstm.py", line 32, in &lt;module&gt;
    import nutils
  File "/usr/local/lib/python2.7/dist-packages/ocrolib/nutils.py", line 25, in &lt;module&gt;
    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 &lt;module&gt;
    import ocrolib
  File "/usr/local/lib/python2.7/dist-packages/ocrolib/__init__.py", line 12, in &lt;module&gt;
    from common import *
  File "/usr/local/lib/python2.7/dist-packages/ocrolib/common.py", line 18, in &lt;module&gt;
    import lstm
  File "/usr/local/lib/python2.7/dist-packages/ocrolib/lstm.py", line 32, in &lt;module&gt;
    import nutils
  File "/usr/local/lib/python2.7/dist-packages/ocrolib/nutils.py", line 25, in &lt;module&gt;
    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 &lt;module&gt;
    import ocrolib
  File "/usr/local/lib/python2.7/dist-packages/ocrolib/__init__.py", line 12, in &lt;module&gt;
    from common import *
  File "/usr/local/lib/python2.7/dist-packages/ocrolib/common.py", line 18, in &lt;module&gt;
    import lstm
  File "/usr/local/lib/python2.7/dist-packages/ocrolib/lstm.py", line 32, in &lt;module&gt;
    import nutils
  File "/usr/local/lib/python2.7/dist-packages/ocrolib/nutils.py", line 25, in &lt;module&gt;
    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
</code></pre>

<p>Since this is as python issue, I haven't tagged OCROpus, should I tag it as well? 
Could it be an Python installation matter? If so, how can I solve it?</p>

<p>Problem solved.
I saw other people having trouble (on diverse matters) with:  </p>

<blockquote>
  <p>OSError:<strong>[X]</strong>... : file too short</p>
</blockquote>

<p>My suggestion is: whatever you are doing, check for hidden directories named [X] in the current directory and delete them.</p>

python