discuss-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Discuss-gnuradio] Basic python question


From: Ryan Connelly
Subject: Re: [Discuss-gnuradio] Basic python question
Date: Thu, 7 Jun 2012 08:39:01 -0400

Type $PYTHONPATH in bash what does it return? Also from the Python
interpreter (type python in bash), type

import sys
sys.path

What does this return?

They should return things like /usr/lib64 (and
lib)/python2.7/site-packages and /usr/local/lib64 (and
lib)/python2.7/site-packages.

So what python does when it looks for a module to import, it looks in
those folders defined by pythonpath and sys.path. If you want to
import a package that's called rtlsdr, there should be a folder in one
of the site-packages folders called rtlsdr. Additionally in that
folder there should be a __init__.py file. That's how finding modules
works in a nutshell.

If you didn't have a PYTHONPATH, type this into a bash prompt to set
one (it will set for that user only)

export 1 >> $PYTHONPATH=/usr/local/lib64/python2.7/site-packages

reference: http://docs.python.org/tutorial/modules.html

On Wed, Jun 6, 2012 at 11:28 PM, Phil <address@hidden> wrote:
> I'm almost afraid to ask such a basic question. A Google search shows that
> the Internet is awash with all sorts of tutorials but I still haven't
> discovered the answer.
>
> It dawned on me a couple of days ago that gnuradio is not a plug-and -play
> SDR, like several of the Windows SDR applications that I've played with, but
> a series of building blocks. My journey into gnuradio came to a halt very
> quickly.
>
> My question is, how do I tell Python (I'm using it from the command line, no
> IDE yet) where the modules are located? As in the following example.
>
>>>> from rtlsdr import *
> Traceback (most recent call last):
>  File "<stdin>", line 1, in <module>
> ImportError: No module named rtlsdr
>
> --
> Regards,
> Phil
>
> _______________________________________________
> Discuss-gnuradio mailing list
> address@hidden
> https://lists.gnu.org/mailman/listinfo/discuss-gnuradio



reply via email to

[Prev in Thread] Current Thread [Next in Thread]