discuss-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Discuss-gnuradio] Strange behaviour while importing oot module


From: Volker Schroer
Subject: [Discuss-gnuradio] Strange behaviour while importing oot module
Date: Sat, 29 Apr 2017 17:54:55 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0

Hi,
I just wrote a new oot module rshfiq with gnuradio v3.7.9.1-145-g5e383b0b

I get problems to load my module.
Testing directly with python, I get:


 $ python
Python 2.7.13 (default, Mar 30 2017, 12:47:27)
[GCC 5.4.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import rshfiq
>>> a=rshfiq.rshfiq()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'rshfiq'
>>>

First I thought that I made a program error, but by chance I found out that calling my module this way works:

$ python
Python 2.7.13 (default, Mar 30 2017, 12:47:27)
[GCC 5.4.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import fcdproplus
>>> import rshfiq
>>> a=rshfiq.rshfiq()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
File "/usr/local/gnuradio/lib64/python2.7/site-packages/rshfiq/rshfiq_swig.py", line 134, in make
    return _rshfiq_swig.rshfiq_make(*args, **kwargs)
TypeError: Required argument 'audio_device_name' (pos 1) not found
>>>

which is correct.

So I looked into the __init__.py file of my module.
The relevant part is

# import swig generated symbols into the rshfiq namespace
try:
  # this might fail if the module is python-only
  from rshfiq_swig import *
except ImportError:
  pass


As in older modules the try .... except is missing, I modified this to

from rshfiq_swig import *

Then I get the following resutls:

$ python
Python 2.7.13 (default, Mar 30 2017, 12:47:27)
[GCC 5.4.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import rshfiq
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
File "/usr/local/gnuradio/lib64/python2.7/site-packages/rshfiq/__init__.py", line 33, in <module>
    from rshfiq_swig import *
File "/usr/local/gnuradio/lib64/python2.7/site-packages/rshfiq/rshfiq_swig.py", line 17, in <module>
    _rshfiq_swig = swig_import_helper()
File "/usr/local/gnuradio/lib64/python2.7/site-packages/rshfiq/rshfiq_swig.py", line 16, in swig_import_helper
    return importlib.import_module('_rshfiq_swig')
File "/usr/lib64/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
ImportError: No module named _rshfiq_swig
>>>

and

$ python
Python 2.7.13 (default, Mar 30 2017, 12:47:27)
[GCC 5.4.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import fcdproplus
>>> import rshfiq
>>> a=rshfiq.rshfiq()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
File "/usr/local/gnuradio/lib64/python2.7/site-packages/rshfiq/rshfiq_swig.py", line 134, in make
    return _rshfiq_swig.rshfiq_make(*args, **kwargs)
TypeError: Required argument 'audio_device_name' (pos 1) not found
>>>

Any ideas ? I think I made a mistake, but I have no further ideas how to find.

Thanks in advance

-- Volker







reply via email to

[Prev in Thread] Current Thread [Next in Thread]