# Installing gnuradio when Python is installed at custom location

**URL:** <https://www.ruby-forum.com/t/installing-gnuradio-when-python-is-installed-at-custom-location/231811>\
**Category:** GNU Radio\
**Created:** [September 1, 2014, 12:03am UTC](https://www.ruby-forum.com/t/installing-gnuradio-when-python-is-installed-at-custom-location/231811 "2014-09-01T00:03:29Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![addis\_a](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/c4cdca/32.png) [@addis\_a](https://www.ruby-forum.com/u/addis_a)\
**Post date:** [September 1, 2014, 12:03am UTC](https://www.ruby-forum.com/t/installing-gnuradio-when-python-is-installed-at-custom-location/231811/1 "2014-09-01T00:03:29Z")

</div>

Hi,I am trying to install gnuradio on Kubuntu 14.04 64 bit. I am using  
the  
binaries from the main Ubuntu software repository to install the same by  
running the following: sudo apt-get install gnuradioThe installation  
works  
fine. However, when I tried running gnuradio-companion, I got the GUI  
indicating the following:Cannot import gnuradio.Is the python path  
environment variable set correctly? All OS: PYTHONPATHI felt that  
this  
could be due to the fact that I have Anaconda’s Python  
[https://store.continuum.io/cshop/anaconda/](https://store.continuum.io/cshop/anaconda/) installed, which I do so  
for  
several reasons. So, my Python runs from /home/nipun/anaconda/bin as  
opposed to the default Ubuntu path. I verified this by importing  
gnuradio  
from Python run by /usr/bin/python as opposed to Anaconda’s python  
(/home/nipun/anaconda/bin/python). I could import gnuradio from  
/usr/bin/python.This suggests that gnuradio picks up the default Ubuntu  
python location. I then uninstalled gnuradio using sudo apt-get remove  
gnuradio and set my PATHS as in .bashrc, did a sudo ldconfig and source  
.bashrc. My paths at this point were as follows:nipun@nipun-batra:~$  
echo  
$LD\_LIBRARY\_PATH  
/usr/lib32:/home/nipun/anaconda/bin:/usr/local/libnipun@nipun-batra:~$  
echo  
$PYTHONPATH /home/nipun/anaconda/bin:However, even after this point,  
gnuradio would work from default Ubuntu path only. Also,  
gnuradio-companion  
would naturally complain and not startup.Question 1: How can we set  
custom  
Python path for gnuradio to install to?Question 2: Anaconda has made  
life  
much easier for the scientific Python community. It makes installing on  
Windows, Mac and Linux pretty easy. Also, dependencies such as numpy,  
scipy,  
etc. are also taken care of. Would the gnuradio team consider putting up  
a  
package on Anaconda. The Anaconda team look pretty helpful and should be  
willing to help. I think that this can save a lot of questions on  
installation related questions across different environments.

---

<div class="post-metadata">

**Author:** ![nipun](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/85f322/32.png) [@nipun](https://www.ruby-forum.com/u/nipun)\
**Post date:** [September 1, 2014, 1:00am UTC](https://www.ruby-forum.com/t/installing-gnuradio-when-python-is-installed-at-custom-location/231811/2 "2014-09-01T01:00:39Z")

</div>

As stated on  
[http://code.ettus.com/redmine/ettus/projects/uhd/wiki/GNURadio\_Linux](http://code.ettus.com/redmine/ettus/projects/uhd/wiki/GNURadio_Linux) the  
installation of gnuradio will not necessarily install all dependencies.  
They recommend to run

sudo apt-get install python python-wxgtk2.8 pyqt4-dev-tools  
python-qwt5-qt4 python-numpy libboost-all-dev libusb-1.0.0-dev

I would also recommend to install the GNU Radio with Ettus repositories  
instead of the ones of Ubuntu.

2014-08-31 16:02 GMT-06:00 nipun [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

---

<div class="post-metadata">

**Author:** ![nipun](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/85f322/32.png) [@nipun](https://www.ruby-forum.com/u/nipun)\
**Post date:** [September 1, 2014, 5:46pm UTC](https://www.ruby-forum.com/t/installing-gnuradio-when-python-is-installed-at-custom-location/231811/3 "2014-09-01T17:46:00Z")

</div>

You can set Python-specific CMake vars to your locations, e.g.  
PYTHON\_INCLUDE\_DIR and PYTHON\_LIBRARY.

M

---

<div class="post-metadata">

**Author:** ![nipun](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/85f322/32.png) [@nipun](https://www.ruby-forum.com/u/nipun)\
**Post date:** [September 1, 2014, 1:38am UTC](https://www.ruby-forum.com/t/installing-gnuradio-when-python-is-installed-at-custom-location/231811/4 "2014-09-01T01:38:19Z")

</div>

Thanks for your reply. However, this does not solve the problem, which I  
suppose may involve compiling the package and passing in the appropriate  
Python locations maybe?

On Sun, Aug 31, 2014 at 7:00 PM, haroldmk [via GnuRadio] \<

---

<div class="post-metadata">

**Author:** ![nipun](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/85f322/32.png) [@nipun](https://www.ruby-forum.com/u/nipun)\
**Post date:** [September 1, 2014, 7:16pm UTC](https://www.ruby-forum.com/t/installing-gnuradio-when-python-is-installed-at-custom-location/231811/5 "2014-09-01T19:16:49Z")

</div>

The clue is in the bits that say FALSE in the output:

Configuring gnuradio-companion support…  
– Dependency ENABLE\_GNURADIO\_RUNTIME = ON  
– Dependency ENABLE\_PYTHON = ON  
– Dependency PYTHON\_MIN\_VER\_FOUND = TRUE  
– Dependency CHEETAH\_FOUND = TRUE  
– Dependency LXML\_FOUND = TRUE  
– Dependency PYGTK\_FOUND = FALSE  
– Dependency NUMPY\_FOUND = TRUE  
– Disabling gnuradio-companion support.  
– Override with -DENABLE\_GRC=ON/OFF

– Configuring gr-qtgui support…  
– Dependency Boost\_FOUND = 1  
– Dependency QT4\_FOUND = FALSE  
– Dependency QWT\_FOUND = FALSE  
– Dependency ENABLE\_VOLK = ON  
– Dependency ENABLE\_GNURADIO\_RUNTIME = ON  
– Dependency ENABLE\_GR\_FFT = ON  
– Dependency ENABLE\_GR\_FILTER = ON  
– Dependency PYTHONLIBS\_FOUND = TRUE  
– Dependency PYQT4\_FOUND = TRUE  
– Disabling gr-qtgui support.  
– Override with -DENABLE\_GR\_QTGUI=ON/OFF

Therefore you need to install pygtk, qt4 and qwt.

Just search using ‘synaptic’.

Mike

–  
Mike J. M0MIK BSc MIET  
Email: removed\_email\_address@domain.invalid  
Web: [http://scanoo.com](http://scanoo.com)

---

<div class="post-metadata">

**Author:** ![nipun](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/85f322/32.png) [@nipun](https://www.ruby-forum.com/u/nipun)\
**Post date:** [September 1, 2014, 6:57pm UTC](https://www.ruby-forum.com/t/installing-gnuradio-when-python-is-installed-at-custom-location/231811/6 "2014-09-01T18:57:20Z")

</div>

Hi,  
Thanks. I did this and am almost able to get everything working.

Following is the command I am invoking:

nipun@nipun-batra:~/git/gnuradio/build$ cmake  
-DPYTHON\_EXECUTABLE=/home/nipun/anaconda/bin/python2.7  
-DPYTHON\_INCLUDE\_DIR=/home/nipun/anaconda/include/  
-DPYTHON\_LIBRARY=/home/nipun/anaconda/lib/libpython2.7.so  
-DCMAKE\_INSTALL\_PREFIX=/usr ../

Everything seems ok. But, gnuradio-companion and gr-qtqui end up in  
disabled components. I have attached the entire log file. Would  
appreciate  
if I am helped to figure how to have 0 disabled components.

On Mon, Sep 1, 2014 at 11:45 AM, Martin B.-2 [via GnuRadio] \<  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)\> wrote:

> > ```
> > sudo apt-get install python python-wxgtk2.8 pyqt4-dev-tools
> > 2014-08-31 16:02 GMT-06:00 nipun <[hidden email]
> > <https://store.continuum.io/cshop/anaconda/> installed, which I
> > $LD_LIBRARY_PATH
> > Anaconda. The Anaconda team look pretty helpful and should be
> > <http://gnuradio.4.n7.nabble.com/> at Nabble.com.
> > Discuss-gnuradio mailing list
> > 
> > ```
> > 
> > * * *
> > 
> > Discuss-gnuradio mailing list

[http://gnuradio.4.n7.nabble.com/template/NamlServlet.jtp?macro=macro\_viewer&id=instant\_html!nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify\_subscribers!nabble%3Aemail.naml-instant\_emails!nabble%3Aemail.naml-send\_instant\_email!nabble%3Aemail.naml](http://gnuradio.4.n7.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml)

> 

out\_log.txt (19K)  
[http://gnuradio.4.n7.nabble.com/attachment/50177/0/out\_log.txt](http://gnuradio.4.n7.nabble.com/attachment/50177/0/out_log.txt)
