pyFFTW doesn't find libfftw3l.so while import
<p>In my Raspbian system I have succesfully installed pyFFTW, but there is a problem while import package.</p>

<pre><code>  import pyfftw
    File "/usr/local/lib/python3.4/dist-packages/pyfftw/__init__.py", line 16, in &lt;module&gt;
  from .pyfftw import ( 
ImportError: libfftw3l.so.3: cannot open shared object file: No such file or directory
</code></pre>

<p>Actually, I have FFTW installed from source.</p>

<hr>

<p>I've dig into __init__.py and there is an <strong>relative import</strong> line:</p>

<pre><code>from .pyfftw import (
              FFTW
              blah blah )
</code></pre>

<p>there is no module pyfftw in the . folder but I suppose this line indicates to ./<strong>pyfftw.cpython-34m.so</strong> file which probably wraps C code of FFTW.</p>

<p>How to tell to this pyfftw.cpython-34m.so file where it should look for correct path?</p>

<p>The problem was with PYTHONPATH.</p>

<p>To check if the file is somewhere at the disk:</p>

<pre><code>$ sudo file / -name libfftw3l.so.3
/home/pi/bin/fftw-3.3.5/.libs/libfftw3.so.3
/usr/lib/arm-linux-gnueabihf/libfftw3.so.3
/usr/local/lib/libfftw3.so.3
</code></pre>

<p>And add a line before import pyfftw (see <a href="https://docs.python.org/3/tutorial/modules.html" rel="nofollow" title="here">here</a>):</p>

<pre><code>import sys
sys.path.append('/usr/local/lib/libfftw3.so.3')
</code></pre>

python path pyfftw