# GRC Importing modules from local directory

**URL:** <https://www.ruby-forum.com/t/grc-importing-modules-from-local-directory/212557>\
**Category:** GNU Radio\
**Created:** [October 6, 2011, 8:50am UTC](https://www.ruby-forum.com/t/grc-importing-modules-from-local-directory/212557 "2011-10-06T08:50:42Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dubstep](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/cdc98d/32.png) [@dubstep](https://www.ruby-forum.com/u/dubstep)\
**Post date:** [October 6, 2011, 8:50am UTC](https://www.ruby-forum.com/t/grc-importing-modules-from-local-directory/212557/1 "2011-10-06T08:50:42Z")

</div>

Using GRC “import block”, i want to import some custom modules from a  
local  
directory  
(same directory contains grc files and other files that needs to be  
imported), but it is giving error.  
As i understood, GRC doesn’t recognizes the directory in which we save  
‘\*.grc’ as its working directory  
How can i import these modules?

Regards  
Adeel

---

<div class="post-metadata">

**Author:** ![adeel\_anwar](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/3bc359/32.png) [@adeel\_anwar](https://www.ruby-forum.com/u/adeel_anwar)\
**Post date:** [October 6, 2011, 8:56am UTC](https://www.ruby-forum.com/t/grc-importing-modules-from-local-directory/212557/2 "2011-10-06T08:56:16Z")

</div>

On 10/05/2011 11:50 PM, adeel anwar wrote:

> 

As with all things python. Put the modules in your PYTHONPATH. If you  
can import the module from a python shell, it will work in GRC.

-josh

---

<div class="post-metadata">

**Author:** ![adeel\_anwar](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/3bc359/32.png) [@adeel\_anwar](https://www.ruby-forum.com/u/adeel_anwar)\
**Post date:** [October 6, 2011, 11:04am UTC](https://www.ruby-forum.com/t/grc-importing-modules-from-local-directory/212557/3 "2011-10-06T11:04:07Z")

</div>

While writing python programs we can import any module from same  
directory  
directly (no need to put it in python path)  
e.g. in “gnuradio-examples\>digital\>benchmark\_loopback.py” 2 modules  
transmit\_path and receive\_path are imported.  
Even if we copy this “digital” to some other place e.g. desktop, these  
files  
will still be imported without error.  
Can’t we do same in GRC?  
As u told by putting these modules in python path we can import in GRC  
but  
if i write an example and wants to distribute,  
it should be able to run in any directory as it is without the  
requirement  
to put in python path (e.g. digital mentioned above)

Adeel
