# Cannot import name GNURadio when launching perf-monitorx and ctrlport-monitor

**URL:** <https://www.ruby-forum.com/t/cannot-import-name-gnuradio-when-launching-perf-monitorx-and-ctrlport-monitor/242840>\
**Category:** GNU Radio\
**Created:** [August 1, 2015, 7:33am UTC](https://www.ruby-forum.com/t/cannot-import-name-gnuradio-when-launching-perf-monitorx-and-ctrlport-monitor/242840 "2015-08-01T07:33:57Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sadaf\_N](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/858c86/32.png) [@Sadaf\_N](https://www.ruby-forum.com/u/Sadaf_N)\
**Post date:** [August 1, 2015, 7:33am UTC](https://www.ruby-forum.com/t/cannot-import-name-gnuradio-when-launching-perf-monitorx-and-ctrlport-monitor/242840/1 "2015-08-01T07:33:57Z")

</div>

I am trying to measure performance of my OOT module with performance  
counter and control port.

When I execute a command line `gr-perf-monitorx` or  
`gr-ctrlport-monitor`,  
an error below occurred:

```
    File

```

“/usr/local/lib/python2.7/dist-packages/gnuradio/ctrlport/GrDataPlotter.py”,  
line 26, in   
from gnuradio.ctrlport import GNURadio  
ImportError: cannot import name GNURadio

Could anyone give me a hint for this?

For detail information, I’ve installed GNU Radio with `build-gnuradio`  
script. The last commit of cloned git repository in my PC is `d5cea6e4( https://gnuradio.org/redmine/projects/gnuradio/repository/revisions/d5cea6e44e29db6b62fabe2b1e5ec16e91b41e68)`  
in Jun 22 2015. I can’t remember exactly, but I think this commit was  
used  
to install the GNU Radio.

Regards,  
Jeon.

---

<div class="post-metadata">

**Author:** ![Jeon](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e8c25b/32.png) [@Jeon](https://www.ruby-forum.com/u/Jeon)\
**Post date:** [August 1, 2015, 7:42am UTC](https://www.ruby-forum.com/t/cannot-import-name-gnuradio-when-launching-perf-monitorx-and-ctrlport-monitor/242840/2 "2015-08-01T07:42:43Z")

</div>

The same error happens in the 3.7.8 release candidate.

– Volker

---

<div class="post-metadata">

**Author:** ![Jeon](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e8c25b/32.png) [@Jeon](https://www.ruby-forum.com/u/Jeon)\
**Post date:** [August 3, 2015, 5:06pm UTC](https://www.ruby-forum.com/t/cannot-import-name-gnuradio-when-launching-perf-monitorx-and-ctrlport-monitor/242840/3 "2015-08-03T17:06:37Z")

</div>

On Sat, Aug 1, 2015 at 1:41 AM, Volker S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> an error below occurred:  
> script. The last commit of cloned git repository in my PC is `d5cea6e4(

[https://gnuradio.org/redmine/projects/gnuradio/repository/revisions/d5cea6e44e29db6b62fabe2b1e5ec16e91b41e68](https://gnuradio.org/redmine/projects/gnuradio/repository/revisions/d5cea6e44e29db6b62fabe2b1e5ec16e91b41e68))`

> in Jun 22 2015. I can’t remember exactly, but I think this commit was used  
> to install the GNU Radio.
> 
> Regards,  
> Jeon.

This sounds as if Thrift wasn’t found when running cmake. Our cmake  
scripts  
use thrift to compile our gnuradio.thrift file into C++ and Python code  
that is installed with GNU Radio.

The output of cmake will tell you if it found Thrift or not. Look under  
the  
list of enabled components for:

– \* gr-ctrlport  
– \* \* thrift

Tom

---

<div class="post-metadata">

**Author:** ![Jeon](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e8c25b/32.png) [@Jeon](https://www.ruby-forum.com/u/Jeon)\
**Post date:** [August 5, 2015, 3:53pm UTC](https://www.ruby-forum.com/t/cannot-import-name-gnuradio-when-launching-perf-monitorx-and-ctrlport-monitor/242840/4 "2015-08-05T15:53:04Z")

</div>

On Wed, Aug 5, 2015 at 2:15 AM, Jeon [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Installing thrift:  
> $ ./configure
> 
> ```
> $ cmake ..
> # or
> 
> ```
> 
> If you have a system with some fresh installation and configuration, it  
> won’t be a problem.
> 
> Regards,  
> Jeon.

We write this page to help people build Thrift:  
[http://gnuradio.org/redmine/projects/gnuradio/wiki/ControlPort](http://gnuradio.org/redmine/projects/gnuradio/wiki/ControlPort)

But there are some good hints here about resetting cmake in GNU Radio to  
get it to recognize Thrift after installation.

Thanks,  
Tom

---

<div class="post-metadata">

**Author:** ![Jeon](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e8c25b/32.png) [@Jeon](https://www.ruby-forum.com/u/Jeon)\
**Post date:** [August 5, 2015, 8:17am UTC](https://www.ruby-forum.com/t/cannot-import-name-gnuradio-when-launching-perf-monitorx-and-ctrlport-monitor/242840/5 "2015-08-05T08:17:24Z")

</div>

Dear Tom,

Thanks for your advice.

Actually, I’ve got a trouble for days installing Thrift and enabling it  
from GNU Radio.

This is just a simple wrap-up for readers who are not familiar with  
compiling and building things.)

Installing thrift:

1. Get Thrift 0.9.2

2. Extract it and build. Make sure that you have all of pre-requisites.

3. Check python can import Thrift

3-1. If python can’t, do the followings:

```
$ cd thrift-0.9.2/lib/py
$ sudo python setup.py install

Go back step 3. And check again.

```

1. Build GNU Radio.

4-1. One important thing is, I recommend you to delete everythink inside  
build directory.

```
At least, I recommend you to remove CMakeCache.txt:

$ cd build
$ rm -rf ./
# or
$ rm CMakeCache.txt

This file can help executing cmake, but sometimes it makes cmake get

```

wrong variables.

```
I've spent days to figure out this. cmakek gives me a wrong thrift

```

binary path /usr/bin/thrift.  
Actually, I have thrift under /usr/local/bin.

I think it’s a quite unusual case since I have been messing around my  
PC.  
If you have a system with some fresh installation and configuration, it  
won’t be a problem.

Regards,  
Jeon.

2015-08-04 0:05 GMT+09:00 Tom R. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):
