Error "No such file or directory" when i import a ".so" file and that file is available in python
<p>I have a python code and some nao files(naoqi.py,_inaoqi.so, ...) in a folder in a raspberry pi 3 model B v1.2 with armv7l. my code has some import line:</p>

<pre><code>import sys
from naoqi import ALProxy
import time
import almath
import os
import socket
</code></pre>

<p>when i run this code i see "cannot open shared object file: No such file or directory" error from second line :</p>

<pre><code>from naoqi import ALProxy
</code></pre>

<p>and in below line in naoqi.py (in line <code>import _inaoqi</code>):</p>

<pre><code>try:
    import _inaoqi
except ImportError:
    # quick hack to keep inaoqi.py happy
    if sys.platform.startswith("win"):
        print "Could not find _inaoqi, trying with _inaoqi_d"
        import _inaoqi_d as _inaoqi
    else:
        raise
</code></pre>

<p>this file is available, but i see "cannot open shared object file: No such file or directory" error.</p>

<p>Why such an error occurs.</p>

<p>What can i do?</p>

<p>Just dumping the inaoqi files into your program directory isn't sufficient, you have to package them properly as a "python module."  Is there an installer available for an inaoqi package, or can it be installed using pip?</p>

<p>Also, if you're running Python on Windows, the <code>.so</code> file isn't going to do you any good.  The C or C++ code for the module on Windows will be in a <code>.dll</code> file, so again, check to see if an installer for the module is available for your platform.</p>

python importerror raspberry-pi3 nao-robot