Cannot import gnuradio

Dear Helper,

I had installed GNU Radio, but when I run gnuradio-companion in Ubuntu
Terminal, I received the following message:

Cannot import gnuradio.

*Is the python path environment variable set correctly?
*

  • All OS: PYTHONPATH*

Is the library path environment variable set correctly?

  • Linux: LD_LIBRARY_PATH*
  • Windows: PATH*
  • MacOSX: DYLD_LIBRARY_PATH*

I had set the path in .bashrc and .profile

export PYTHONPATH=$PYTHONPATH:/usr/local/lib/python2.7/dist-packages
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib

Thank you.

Regards,
Tanaga Biru

hi,

this can happen if you forget to do:

sudo ldconfig

Il 15/06/13 13:02, Tanaga Biru ha scritto:

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
Discuss-gnuradio Info Page
Hi Tanaga, follow these steps :

1. Uninstall gnuradio with “sudo make uninstall”

2. Remove all the “export”(s) in the .profile and .bashrc files or
better leave only :

/export PYTHONPATH=$PYTHONPATH:/usr/local/lib/python2.7/dist-packages/

in the .bashrc file

3. go back in the root folder of the gnuradio source and remove the
“build” folder you used to compile gnuradio.

/rm -rf build//

4. Edit the CMakeLists.txt file in the gnuradio root folder in the
following way as described here :

https://bbs.archlinux.org/viewtopic.php?id=147452

     replace :

// /find_package(PythonLibs)/

     with :

/find_package(PythonLibs )/

you’ll get the python version from your shell

5. rebuiild and install gnuradio in the usual way. All the issues
should be fixed now…Let me know…

Kind Regards,

              Arturo

Nella citazione in data sab 15 giu 2013 17:36:52 CEST, swrangsar
basumatary ha scritto:

On Sat, Jun 15, 2013 at 4:32 PM, Tanaga Biru <[email protected]
*

[email protected] <mailto:[email protected]>
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio

Discuss-gnuradio mailing list
[email protected]
Discuss-gnuradio Info Page

I took for granted that Tanaka did “sudo ldconfig” as last step of the
building process. The Ubuntu derivatives (such as Kubuntu) suffer from
this issue.

Regards, Arturo

On 06/19/2013 02:22 AM, Favati wrote:

All OS: PYTHONPATH
export PYTHONPATH=$PYTHONPATH:/usr/local/lib/python2.7/dist-packages


Discuss-gnuradio mailing list
[email protected]
Discuss-gnuradio Info Page

If you open up a terminal window and type:

echo $PYTHONPATH

What do you get?

Do you have Python2.7 installed? What is actually in directory
/usr/local/lib/python2.7/dist-packages?


Marcus L.
Principal Investigator
Shirleys Bay Radio Astronomy Consortium

Il 15/06/2013 13:02, Tanaga Biru ha scritto:

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib

Thank you.

Regards,
Tanaga Biru
Same here…fresh and updated ubuntu 13.04 64bit :frowning:

If you open up a terminal window and type:

echo $PYTHONPATH

What do you get?

/usr/local/lib/python2.7/dist-packages

Do you have Python2.7 installed? What is actually in directory
/usr/local/lib/python2.7/dist-packages?

  • yes

cd /usr/local/lib/python2.7/dist-packages
ls -l

michele@Workstation:/usr/local/lib/python2.7/dist-packages$ ls -l
totale 220
drwxr-sr-x 2 root staff 4096 giu 17 17:27 baz
drwxr-sr-x 2 root staff 4096 mar 8 2012 cpyrit
-rw-r–r-- 1 root staff 950 mar 8 2012
cpyrit_cuda-0.4.1_dev.egg-info
drwxr-sr-x 23 root staff 4096 giu 17 17:24 gnuradio
drwxr-sr-x 4 root staff 4096 giu 17 17:24 grc_gnuradio
drwxr-sr-x 3 root staff 4096 giu 17 17:23 gruel
drwxr-sr-x 2 root staff 4096 giu 17 17:24 iqbalance
drwxr-sr-x 2 root staff 4096 giu 17 17:25 osmosdr
-rw-r–r-- 1 root staff 932 mar 8 2012 pyrit-0.4.1_dev.egg-info
-rw-r–r-- 1 root staff 67993 mar 8 2012 pyrit_cli.py
-rw-r–r-- 1 root staff 55139 mar 8 2012 pyrit_cli.pyc
-rw-r–r-- 1 root staff 55139 mar 8 2012 pyrit_cli.pyo
michele@Workstation:/usr/local/lib/python2.7/dist-packages$

On 06/19/2013 08:57 AM, Marcus D. Leech wrote:

All OS: PYTHONPATH
*
*
Is the library path environment variable set correctly?
Linux: LD_LIBRARY_PATH
Windows: PATH
MacOSX: DYLD_LIBRARY_PATH

I’m thinking this message could also hint at that magic incantation of
sudo ldconfig.

But seriously, run sudo ldconfig, the OS pretends not to know about
installed libraries until the cache is updated.

-josh


Discuss-gnuradio mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio

Il 19/06/2013 20:06, Marcus L. ha scritto:

Hmm, is PYTHONPATH marked for export in your .bashrc?

Why? I use the export at the command prompt (and yes…i try to launch
the gnuradio companion in the same shell).

I’ll try to put PYTHONPATH in .bashrc…but i don’t think it should make
any difference.


Discuss-gnuradio mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio

On 06/20/2013 02:06 AM, Favati wrote:


Discuss-gnuradio mailing list
[email protected]
Discuss-gnuradio Info Page

I find it’s vastly more convenient to do that stuff in my .bashrc than
to type it manually every time I start a shell or launch a command…

Have you tried “sudo ldconfig”?


Marcus L.
Principal Investigator
Shirleys Bay Radio Astronomy Consortium

I find it’s vastly more convenient to do that stuff in my .bashrc than
to type it manually every time I start a shell or launch a command…

sure, but before making changes to my .bashrc, i usually try the manual
way before.

Have you tried “sudo ldconfig”?

yes, but i get the same error…today i’ve tryed to install gnuradio
(of course using the script) on another fresh machine (x64, like mine),
and i get the same exact error.
Is there any other things to try?

Many thanks