discuss-gnuradio
[Top][All Lists]
Advanced

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

Help with Python import


From: Gisle Vanem
Subject: Help with Python import
Date: Wed, 25 Mar 2020 11:12:40 +0100
User-agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0

Hi list.

I've having troubles understanding how GnuRadio and Python 3.x
in particular should be told to import stuff under
'<GR_INSTALL_ROOT>/lib/site-pages'. I have a 'PYTHONPATH'
containing both:
  <GR_INSTALL_ROOT>/lib/site-pages
  <GR_INSTALL_ROOT>/lib/site-pages/volk_modtool
  etc.

But yet a statement like (in '<GR_INSTALL_ROOT>/bin/volk_modtool.py'):
  from volk_modtool import volk_modtool, volk_modtool_config

causes Python 3.x to error out with:
  ImportError: cannot import name 'volk_modtool'

But patching it into, it works [1]:

--- a/volk_modtool/volk_modtool.py          2020-02-03 09:55:18
+++ b <GR_INSTALL_ROOT>/bin/volk_modtool.py 2020-03-25 09:44:29
@@ -21,7 +21,7 @@
 #


-from volk_modtool import volk_modtool, volk_modtool_config
+from volk_modtool import *
 from optparse import OptionParser, OptionGroup

 import os
------------------

What does the syntax "from volk_modtool import x, y" require
or do in comparison to the "from volk_modtool import *" syntax?

Anybody care to enlighten a Python newbie?

[1]: volk_modtool.py -m:

         (__)
         (oo)
   /------\/
  / |    ||
 *  /\---/\
    ~~   ~~

--
--gv



reply via email to

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