[MacPorts] #47922: ImportError: No module named gnuradio
#47922: ImportError: No module named gnuradio ------------------------------+-------------------------------- Reporter: plcortesc@… | Owner: macports-tickets@… Type: defect | Status: new Priority: High | Milestone: Component: wiki | Version: 2.3.3 Keywords: gnuradio, python | Port: ------------------------------+-------------------------------- Hello everyone! I have some troubles trying to execute a GNURadio python script. Gnuradio- companion works well, but when I modify the python script in order to modify the blocks, I cannot execute it from the terminal getting always this error: $ python top_block.py Traceback (most recent call last): File "top_block.py", line 8, in <module> from gnuradio import eng_notation ImportError: No module named gnuradio Then I try to set up the environment variable $PYTHONPATH as follows: $ export PYTHONPATH=/opt/local/lib/python2.7/site-packages:$PYTHONPATH Now, the error changes when I try to run the top_block.py script: $ python top_block.py Traceback (most recent call last): File "top_block.py", line 9, in <module> from gnuradio import gr File "/usr/local/lib/python2.7/site-packages/gnuradio/gr/__init__.py", line 41, in <module> File "/usr/local/lib/python2.7/site- packages/gnuradio/gr/runtime_swig.py", line 28, in <module> File "/usr/local/lib/python2.7/site- packages/gnuradio/gr/runtime_swig.py", line 20, in swig_import_helper ImportError: No module named _runtime_swig Do you have any suggestions? I am completely stuck and I don't know how to keep going. Thank you in advance! -- Ticket URL: <https://trac.macports.org/ticket/47922> MacPorts <https://www.macports.org/> Ports system for OS X
#47922: ImportError: No module named gnuradio --------------------------+-------------------------------- Reporter: plcortesc@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: wiki | Version: 2.3.3 Resolution: | Keywords: gnuradio, python Port: | --------------------------+-------------------------------- Changes (by mf2k@…): * priority: High => Normal Comment: The Priority field is for use by Macports team members only. -- Ticket URL: <https://trac.macports.org/ticket/47922#comment:1> MacPorts <https://www.macports.org/> Ports system for OS X
#47922: ImportError: No module named gnuradio --------------------------+-------------------------------- Reporter: plcortesc@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: wiki | Version: 2.3.3 Resolution: | Keywords: gnuradio, python Port: | --------------------------+-------------------------------- Comment (by plcortesc@…): Replying to [comment:1 mf2k@…]:
The Priority field is for use by Macports team members only.
Sorry..it's my first time using this forum. Thank you for the advice :) -- Ticket URL: <https://trac.macports.org/ticket/47922#comment:2> MacPorts <https://www.macports.org/> Ports system for OS X
#47922: ImportError: No module named gnuradio --------------------------+-------------------------------- Reporter: plcortesc@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.3.3 Resolution: | Keywords: Port: gnuradio | --------------------------+-------------------------------- Changes (by ryandesign@…): * keywords: gnuradio, python => * component: wiki => ports * port: => gnuradio Old description:
Hello everyone!
I have some troubles trying to execute a GNURadio python script. Gnuradio-companion works well, but when I modify the python script in order to modify the blocks, I cannot execute it from the terminal getting always this error:
$ python top_block.py
Traceback (most recent call last): File "top_block.py", line 8, in <module> from gnuradio import eng_notation ImportError: No module named gnuradio
Then I try to set up the environment variable $PYTHONPATH as follows:
$ export PYTHONPATH=/opt/local/lib/python2.7/site-packages:$PYTHONPATH
Now, the error changes when I try to run the top_block.py script:
$ python top_block.py Traceback (most recent call last): File "top_block.py", line 9, in <module> from gnuradio import gr File "/usr/local/lib/python2.7/site-packages/gnuradio/gr/__init__.py", line 41, in <module> File "/usr/local/lib/python2.7/site- packages/gnuradio/gr/runtime_swig.py", line 28, in <module> File "/usr/local/lib/python2.7/site- packages/gnuradio/gr/runtime_swig.py", line 20, in swig_import_helper ImportError: No module named _runtime_swig
Do you have any suggestions? I am completely stuck and I don't know how to keep going. Thank you in advance!
New description: Hello everyone! I have some troubles trying to execute a GNURadio python script. Gnuradio- companion works well, but when I modify the python script in order to modify the blocks, I cannot execute it from the terminal getting always this error: {{{ $ python top_block.py Traceback (most recent call last): File "top_block.py", line 8, in <module> from gnuradio import eng_notation ImportError: No module named gnuradio }}} Then I try to set up the environment variable $PYTHONPATH as follows: {{{ $ export PYTHONPATH=/opt/local/lib/python2.7/site-packages:$PYTHONPATH }}} Now, the error changes when I try to run the top_block.py script: {{{ $ python top_block.py Traceback (most recent call last): File "top_block.py", line 9, in <module> from gnuradio import gr File "/usr/local/lib/python2.7/site-packages/gnuradio/gr/__init__.py", line 41, in <module> File "/usr/local/lib/python2.7/site- packages/gnuradio/gr/runtime_swig.py", line 28, in <module> File "/usr/local/lib/python2.7/site- packages/gnuradio/gr/runtime_swig.py", line 20, in swig_import_helper ImportError: No module named _runtime_swig }}} Do you have any suggestions? I am completely stuck and I don't know how to keep going. Thank you in advance! -- Comment: What is "`python`"? Is that Apple's Python, or MacPorts'? You'll probably only have success using MacPorts' Python. You can get that by either running "`/opt/local/bin/python2.7`" every time you want to use MacPorts Python, or by running "`sudo port select --set python python27`" once, which will create a symlink at /opt/local/bin/python pointing to /opt/local/bin/python2.7; from then on, assuming /opt/local/bin is in your PATH, you can just run "`python`". -- Ticket URL: <https://trac.macports.org/ticket/47922#comment:3> MacPorts <https://www.macports.org/> Ports system for OS X
#47922: ImportError: No module named gnuradio --------------------------+-------------------------------- Reporter: plcortesc@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.3.3 Resolution: | Keywords: Port: gnuradio | --------------------------+-------------------------------- Comment (by plcortesc@…): Replying to [comment:3 ryandesign@…]:
What is "`python`"? Is that Apple's Python, or MacPorts'? You'll probably only have success using MacPorts' Python. You can get that by either running "`/opt/local/bin/python2.7`" every time you want to use MacPorts Python, or by running "`sudo port select --set python python27`" once, which will create a symlink at /opt/local/bin/python pointing to /opt/local/bin/python2.7; from then on, assuming /opt/local/bin is in your PATH, you can just run "`python`".
Thank you so much! You have given me the key, however, I have not needed to create any symlink or execute using the whole path to get python2.7, it has been enough to run the script like this: {{{ $ python2.7 top_block.py }}} -- Ticket URL: <https://trac.macports.org/ticket/47922#comment:4> MacPorts <https://www.macports.org/> Ports system for OS X
#47922: ImportError: No module named gnuradio --------------------------+-------------------------------- Reporter: plcortesc@… | Owner: macports-tickets@… Type: defect | Status: closed Priority: Normal | Milestone: Component: ports | Version: 2.3.3 Resolution: invalid | Keywords: Port: gnuradio | --------------------------+-------------------------------- Changes (by ryandesign@…): * status: new => closed * resolution: => invalid -- Ticket URL: <https://trac.macports.org/ticket/47922#comment:5> MacPorts <https://www.macports.org/> Ports system for OS X
participants (1)
-
MacPorts