Opened 9 years ago

Closed 9 years ago

#51107 closed defect (worksforme)

gnuradio 3.7.9.1 ImportError: No module named gnuradio

Reported by: ethicz@… Owned by: michaelld (Michael Dickens)
Priority: Normal Milestone:
Component: ports Version: 2.3.4
Keywords: Cc:
Port: gnuradio

Description

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 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.

Change History (8)

comment:1 Changed 9 years ago by mf2k (Frank Schima)

Owner: changed from macports-tickets@… to michaelld@…

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

comment:2 Changed 9 years ago by michaelld (Michael Dickens)

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!

comment:3 in reply to:  2 Changed 9 years ago by ethicz@…

Replying to 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

And trying to run the python script now still returns the import error.

Last edited 9 years ago by ethicz@… (previous) (diff)

comment:4 Changed 9 years ago by michaelld (Michael Dickens)

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.

comment:5 in reply to:  4 Changed 9 years ago by ethicz@…

Replying to 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

comment:6 Changed 9 years ago by michaelld (Michael Dickens)

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.

comment:7 in reply to:  6 Changed 9 years ago by ethicz@…

Replying to 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!

comment:8 Changed 9 years ago by michaelld (Michael Dickens)

Resolution: worksforme
Status: newclosed

Glad it's working; you're welcome; have fun!

Note: See TracTickets for help on using tickets.