title: GNURadio On Raspberry Pi 3 Reports: No module named _osmosdr_swig
body: <p>I am trying to run a GNURadio flow graph that runs fine on my Windows computer but gives me an error on my Raspberry Pi.
  The error is: </p>
  
  <p>No module named _osmosdr_swig</p>
  
  <p>For some reason line feeds in my perfectly formatted text in these entry fields get removed when I post.  The format instructions say, "for linebreak add 2 spaces at end" but I can't get that to work.</p>
  
  <p>I have tried to add a second line feed to each line.  I hope I didn't miss any.</p>
  
  <p>I just don't know enough Python to understand what is happening.</p>
  
  <p>Here is what GNURadio reported:</p>
  
  <p>Traceback (most recent call last):</p>
  
  <p>File "/home/pi/Documents/Security/top_block.py", line 28, in 
      import osmosdr</p>
  
  <p>File "/usr/local/lib/python2.7/dist-packages/osmosdr/<strong>init</strong>.py", line 26, in 
      from osmosdr_swig import *</p>
  
  <p>File "/usr/local/lib/python2.7/dist-packages/osmosdr/osmosdr_swig.py", line 21, in 
      _osmosdr_swig = swig_import_helper()</p>
  
  <p>File "/usr/local/lib/python2.7/dist-packages/osmosdr/osmosdr_swig.py", line 20, in swig_import_helper
      return importlib.import_module('_osmosdr_swig')</p>
  
  <p>File "/usr/lib/python2.7/importlib/<strong>init</strong>.py", line 37, in import_module
      <strong>import</strong>(name)
  ImportError: No module named _osmosdr_swig</p>
  
  <p>Python code snippets from around the traces are:</p>
  
  <p>From top_block.py</p>
  
  <p>25 from gnuradio.eng_option import eng_option</p>
  
  <p>26 from gnuradio.filter import firdes</p>
  
  <p>27 from optparse import OptionParser</p>
  
  <p>28 import osmosdr</p>
  
  <p>29 import sip</p>
  
  <p>From /usr/local/lib/python2.7/dist-packages/osmosdr/<strong>init</strong>.py</p>
  
  <p>25 # import swig generated symbols into the osmosdr namespace</p>
  
  <p>26 from osmosdr_swig import *</p>
  
  <p>27</p>
  
  <p>28 # import any pure python here</p>
  
  <p>29 #</p>
  
  <p>From /usr/local/lib/python2.7/dist-packages/osmosdr/osmosdr_swig.py</p>
  
  <p>11 from sys import version_info as _swig_python_version_info</p>
  
  <p>12 if _swig_python_version_info >= (2, 7, 0):</p>
  
  <p>13     def swig_import_helper():</p>
  
  <p>14         import importlib</p>
  
  <p>15         pkg = <strong>name</strong>.rpartition('.')[0]</p>
  
  <p>16         mname = '.'.join((pkg, '_osmosdr_swig')).lstrip('.')</p>
  
  <p>17         try:</p>
  
  <p>18             return importlib.import_module(mname)</p>
  
  <p>19         except ImportError:</p>
  
  <p>20             return importlib.import_module('_osmosdr_swig')</p>
  
  <p>21     _osmosdr_swig = swig_import_helper()</p>
  
  <p>22     del swig_import_helper</p>
  
  <p>23 elif _swig_python_version_info >= (2, 6, 0):</p>
  
  <p>From /usr/lib/python2.7/importlib/<strong>init</strong>.py</p>
  
  <p>20 def import_module(name, package=None):</p>
  
  <p>21     """Import a module.</p>
  
  <p>22 </p>
  
  <p>23     The 'package' argument is required when performing a relative 
  import. It</p>
  
  <p>24     specifies the package to use as the anchor point from which to resolve the</p>
  
  <p>25     relative import to an absolute import.</p>
  
  <p>26</p>
  
  <p>27     """</p>
  
  <p>28     if name.startswith('.'):</p>
  
  <p>29         if not package:</p>
  
  <p>30             raise TypeError("relative imports require the 'package' argument")</p>
  
  <p>31         level = 0</p>
  
  <p>32         for character in name:</p>
  
  <p>33             if character != '.':</p>
  
  <p>34                 break</p>
  
  <p>35             level += 1</p>
  
  <p>36         name = _resolve_name(name[level:], package, level)
  37     <strong>import</strong>(name)</p>
  
  <p>38     return sys.modules[name]</p>