[MacPorts] #51107: gnuradio 3.7.9.1 ImportError: No module named gnuradio
#51107: gnuradio 3.7.9.1 ImportError: No module named gnuradio ----------------------+-------------------------------- Reporter: ethicz@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.3.4 Keywords: | Port: gnuradio ----------------------+-------------------------------- Successfully installed gnuradio and companion working fine but having issues running python script through terminal. {{{ ImportError: No module named gnuradio }}} Running OSX 10.11.4 and python 2.7. Following the troubleshooting steps mentioned in [https://trac.macports.org/ticket/28315 Ticket #28315], "ls /opt/local/lib/python2.7/site-packages" returns: {{{ xcbgen }}} And "port installed | grep gnuradio" returns: {{{ gnuradio-devel @20160331_0+docs+grc+jack+portaudio+qtgui+sdl+swig+uhd+wavelet+wxgui (active) }}} It appears the python modules were never installed? I appreciate the help. -- Ticket URL: <https://trac.macports.org/ticket/51107> MacPorts <https://www.macports.org/> Ports system for OS X
#51107: gnuradio 3.7.9.1 ImportError: No module named gnuradio -----------------------+------------------------- Reporter: ethicz@… | Owner: michaelld@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.3.4 Resolution: | Keywords: Port: gnuradio | -----------------------+------------------------- Changes (by mf2k@…): * owner: macports-tickets@… => michaelld@… Comment: In the future, please Cc the port maintainers ({{{port info --maintainers gnuradio}}}), if any. The obvious question is are you using the correct python? What is the output of the following? {{{ which python }}} -- Ticket URL: <https://trac.macports.org/ticket/51107#comment:1> MacPorts <https://www.macports.org/> Ports system for OS X
#51107: gnuradio 3.7.9.1 ImportError: No module named gnuradio -----------------------+------------------------- Reporter: ethicz@… | Owner: michaelld@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.3.4 Resolution: | Keywords: Port: gnuradio | -----------------------+------------------------- Comment (by michaelld@…): GNU Radio's Python interface is installed for you into {{{ /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7 /site-packages/gnuradio }}} You need to make sure `which python` returns `/opt/local/bin/python`; if not, you can set it via: {{{ sudo port select python python27 }}} HTH! -- Ticket URL: <https://trac.macports.org/ticket/51107#comment:2> MacPorts <https://www.macports.org/> Ports system for OS X
#51107: gnuradio 3.7.9.1 ImportError: No module named gnuradio -----------------------+------------------------- Reporter: ethicz@… | Owner: michaelld@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.3.4 Resolution: | Keywords: Port: gnuradio | -----------------------+------------------------- Comment (by ethicz@…): Replying to [comment:2 michaelld@…]:
GNU Radio's Python interface is installed for you into {{{
/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7 /site-packages/gnuradio
}}}
You need to make sure `which python` returns `/opt/local/bin/python`; if not, you can set it via: {{{ sudo port select python python27 }}}
HTH!
I set the python with that command, but which python now returns {{{ /usr/local/bin/python }}} -- Ticket URL: <https://trac.macports.org/ticket/51107#comment:3> MacPorts <https://www.macports.org/> Ports system for OS X
#51107: gnuradio 3.7.9.1 ImportError: No module named gnuradio -----------------------+------------------------- Reporter: ethicz@… | Owner: michaelld@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.3.4 Resolution: | Keywords: Port: gnuradio | -----------------------+------------------------- Comment (by michaelld@…): Are you using HomeBrew? By default it installs into /usr/local, which we generally recommend against using because it is a standard search path for many configuration systems. We also generally recommend not using any 2 or more of HomeBrew, MacPorts, and Fink at the same time -- it's just asking for troubles (like this). That said, if you change the PATH environment variable to have /opt/local/bin come before /usr/local/bin, that should fix this specific issue. There might be others that come up depending on what is installed in /usr/local though. -- Ticket URL: <https://trac.macports.org/ticket/51107#comment:4> MacPorts <https://www.macports.org/> Ports system for OS X
#51107: gnuradio 3.7.9.1 ImportError: No module named gnuradio -----------------------+------------------------- Reporter: ethicz@… | Owner: michaelld@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.3.4 Resolution: | Keywords: Port: gnuradio | -----------------------+------------------------- Comment (by ethicz@…): Replying to [comment:4 michaelld@…]:
Are you using HomeBrew? By default it installs into /usr/local, which we generally recommend against using because it is a standard search path for many configuration systems. We also generally recommend not using any 2 or more of HomeBrew, MacPorts, and Fink at the same time -- it's just asking for troubles (like this).
That said, if you change the PATH environment variable to have /opt/local/bin come before /usr/local/bin, that should fix this specific issue. There might be others that come up depending on what is installed in /usr/local though.
Yes I am using HomeBrew. I tried changing the path environment but couldn't get opt/local/bin to come first. I edited the .bash_profile to include this {{{ export PATH="/opt/local/bin:$PATH" }}} But echo $PATH returns {{{ /usr/bin /bin /usr/sbin /sbin /opt/local/bin /opt/local/sbin /opt/X11/bin }}} -- Ticket URL: <https://trac.macports.org/ticket/51107#comment:5> MacPorts <https://www.macports.org/> Ports system for OS X
#51107: gnuradio 3.7.9.1 ImportError: No module named gnuradio -----------------------+------------------------- Reporter: ethicz@… | Owner: michaelld@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.3.4 Resolution: | Keywords: Port: gnuradio | -----------------------+------------------------- Comment (by michaelld@…): After you edit the .bash_profile, you either need to `source` it or logout & log back in (e.g., restart X11.app or XQuartz.app). Right now, you could issue in the shell your first command (`export PATH="/opt/local/bin:$PATH"`) and see if that works for running GR Python scripts directly. -- Ticket URL: <https://trac.macports.org/ticket/51107#comment:6> MacPorts <https://www.macports.org/> Ports system for OS X
#51107: gnuradio 3.7.9.1 ImportError: No module named gnuradio -----------------------+------------------------- Reporter: ethicz@… | Owner: michaelld@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.3.4 Resolution: | Keywords: Port: gnuradio | -----------------------+------------------------- Comment (by ethicz@…): Replying to [comment:6 michaelld@…]:
After you edit the .bash_profile, you either need to `source` it or logout & log back in (e.g., restart X11.app or XQuartz.app).
Right now, you could issue in the shell your first command (`export PATH="/opt/local/bin:$PATH"`) and see if that works for running GR Python scripts directly.
Just had to restart, it is working now. Thank you! -- Ticket URL: <https://trac.macports.org/ticket/51107#comment:7> MacPorts <https://www.macports.org/> Ports system for OS X
#51107: gnuradio 3.7.9.1 ImportError: No module named gnuradio -------------------------+------------------------- Reporter: ethicz@… | Owner: michaelld@… Type: defect | Status: closed Priority: Normal | Milestone: Component: ports | Version: 2.3.4 Resolution: worksforme | Keywords: Port: gnuradio | -------------------------+------------------------- Changes (by michaelld@…): * status: new => closed * resolution: => worksforme Comment: Glad it's working; you're welcome; have fun! -- Ticket URL: <https://trac.macports.org/ticket/51107#comment:8> MacPorts <https://www.macports.org/> Ports system for OS X
participants (1)
-
MacPorts