# Error related to -ImportError: and swig\_import\_helper()

**URL:** <https://www.ruby-forum.com/t/error-related-to-importerror-and-swig-import-helper/210286>\
**Category:** GNU Radio\
**Created:** [August 4, 2011, 8:07am UTC](https://www.ruby-forum.com/t/error-related-to-importerror-and-swig-import-helper/210286 "2011-08-04T08:07:44Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dubstep](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/cdc98d/32.png) [@dubstep](https://www.ruby-forum.com/u/dubstep)\
**Post date:** [August 4, 2011, 8:07am UTC](https://www.ruby-forum.com/t/error-related-to-importerror-and-swig-import-helper/210286/1 "2011-08-04T08:07:44Z")

</div>

hi all ,  
i have write comedi block while running program i am getting error  
Traceback (most recent call last):  
File “/home/jagdish/top\_block.py”, line 13, in   
import comedi  
File “/usr/local/lib/python2.6/dist-packages/comedi/ **init**.py”, line  
40,  
in   
from comedi\_swig import \*  
File “/usr/local/lib/python2.6/dist-packages/comedi/comedi\_swig.py”,  
line  
24, in   
\_comedi\_swig = swig\_import\_helper()  
File “/usr/local/lib/python2.6/dist-packages/comedi/comedi\_swig.py”,  
line  
20, in swig\_import\_helper  
\_mod = imp.load\_module(‘\_comedi\_swig’, fp, pathname, description)  
ImportError: /usr/local/lib/libgnuradio-comedi-3.3.0.so.0: undefined  
symbol:  
comedi\_open

## thanks

View this message in context:  
[http://old.nabble.com/error-related-to--ImportError%3A-and-swig\_import\_helper()-tp32191854p32191854.html](http://old.nabble.com/error-related-to--ImportError%3A-and-swig_import_helper%28%29-tp32191854p32191854.html)  
Sent from the GnuRadio mailing list archive at [Nabble.com](http://Nabble.com).

---

<div class="post-metadata">

**Author:** ![jagdish\_p](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/c57346/32.png) [@jagdish\_p](https://www.ruby-forum.com/u/jagdish_p)\
**Post date:** [August 4, 2011, 6:08pm UTC](https://www.ruby-forum.com/t/error-related-to-importerror-and-swig-import-helper/210286/2 "2011-08-04T18:08:50Z")

</div>

On 08/03/2011 11:07 PM, patiljagdish154 wrote:

> 24, in   
> \_comedi\_swig = swig\_import\_helper()  
> File “/usr/local/lib/python2.6/dist-packages/comedi/comedi\_swig.py”, line  
> 20, in swig\_import\_helper  
> \_mod = imp.load\_module(‘\_comedi\_swig’, fp, pathname, description)  
> ImportError: /usr/local/lib/libgnuradio-comedi-3.3.0.so.0: undefined symbol:  
> comedi\_open

Did you link with libcomedi? [http://www.comedi.org/doc/r4857.html](http://www.comedi.org/doc/r4857.html)

I just did some work on gr-comedi because it did not compile with the  
recent versions of comedi that come with ubuntu package manager. So I  
have no idea how you built the library in the first place.

Anyway work is here:  
[http://gnuradio.org/redmine/projects/gnuradio/wiki/CMakeWork](http://gnuradio.org/redmine/projects/gnuradio/wiki/CMakeWork)

-josh

---

<div class="post-metadata">

**Author:** ![jagdish\_p](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/c57346/32.png) [@jagdish\_p](https://www.ruby-forum.com/u/jagdish_p)\
**Post date:** [August 5, 2011, 5:47am UTC](https://www.ruby-forum.com/t/error-related-to-importerror-and-swig-import-helper/210286/3 "2011-08-05T05:47:28Z")

</div>

thanks  
i am getting about linking comedilib.  
i think the above error is sort out.now i am getting  
File “/home/jagdish/top\_block.py”, line 36, in   
tb = top\_block()  
File “/home/jagdish/top\_block.py”, line 28, in **init**  
self.comedi\_source\_s\_0 = comedi.source\_s( )  
AttributeError: ‘module’ object has no attribute ‘source\_s’

is this error due python path ?  
i had installed 3 -4 block , i didn’t get such kind of error.  
i using ubuntu 10.10 , python2.6  
all modules(gr, howto ,etc…) that i had installed are stored in  
/usr/local/lib/(\*.so , \*.la \*3.3.0.so.o , \*.3.3.0.so.0.0.0) and in  
/usr/local/lib/python2.6/dist-packages/  
to compile comedi code i C compiler i used  
gcc filename.c -lcomedi -lm and in GNURadio it compile it like normally  
gcc  
filename.c.  
is taht a problem ?

thanks  
jagdish

Josh B.-2 wrote:

> > File “/usr/local/lib/python2.6/dist-packages/comedi/ **init**.py”, line  
> > \_mod = imp.load\_module(‘\_comedi\_swig’, fp, pathname, description)  
> > have no idea how you built the library in the first place.

–  
View this message in context:  
[http://old.nabble.com/error-related-to--ImportError%3A-and-swig\_import\_helper()-tp32191826p32199446.html](http://old.nabble.com/error-related-to--ImportError%3A-and-swig_import_helper%28%29-tp32191826p32199446.html)  
Sent from the GnuRadio mailing list archive at [Nabble.com](http://Nabble.com).
