# NameError

**URL:** <https://forum.inductiveautomation.com/t/nameerror/2840>\
**Category:** Archived Topics\
**Created:** [April 5, 2011, 9:47am UTC](https://forum.inductiveautomation.com/t/nameerror/2840 "2011-04-05T09:47:09Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![bluefrog](https://avatars.discourse-cdn.com/v4/letter/b/a6a055/32.png) [@bluefrog](https://forum.inductiveautomation.com/u/bluefrog)\
**Post date:** [April 5, 2011, 9:47am UTC](https://forum.inductiveautomation.com/t/nameerror/2840/1 "2011-04-05T09:47:09Z")

</div>

I have two functions in script modules like this.

```auto
def b():
	import fpmi
	result = a(c,d)
	fpmi.gui.messageBox(str(result));

def a(c,d):
	return c+d
```

I got an error when I run the function b from a button click event. I attached the error photo. Please help me again. ![:prayer:](https://us1.discourse-cdn.com/inductiveautomation/original/1X/e5a7e3b63facc151ea73e3b45db7bdb3d4bdc316.gif ":prayer:") ![:prayer:](https://us1.discourse-cdn.com/inductiveautomation/original/1X/e5a7e3b63facc151ea73e3b45db7bdb3d4bdc316.gif ":prayer:") ![:prayer:](https://us1.discourse-cdn.com/inductiveautomation/original/1X/e5a7e3b63facc151ea73e3b45db7bdb3d4bdc316.gif ":prayer:")

---

<div class="post-metadata">

**Author:** ![Travis.Cox](https://avatars.discourse-cdn.com/v4/letter/t/b9bd4f/32.png) [@Travis.Cox](https://forum.inductiveautomation.com/u/Travis.Cox)\
**Post date:** [April 5, 2011, 3:40pm UTC](https://forum.inductiveautomation.com/t/nameerror/2840/2 "2011-04-05T15:40:54Z")

</div>

That is because you didn’t import the namespace correctly. Do the following:[code]def b():  
import fpmi, app  
result = app.package.a(c,d)  
fpmi.gui.messageBox(str(result));

def a(c,d):  
return c+d[/code]

---

<div class="post-metadata">

**Author:** ![bluefrog](https://avatars.discourse-cdn.com/v4/letter/b/a6a055/32.png) [@bluefrog](https://forum.inductiveautomation.com/u/bluefrog)\
**Post date:** [April 6, 2011, 1:54am UTC](https://forum.inductiveautomation.com/t/nameerror/2840/3 "2011-04-06T01:54:56Z")

</div>

Thank you so much… I got it… ![:mrgreen:](https://us1.discourse-cdn.com/inductiveautomation/original/1X/d23659b203d2d24d394be983a52adb2fa6fe23d4.gif "Mr. Green") ![:mrgreen:](https://us1.discourse-cdn.com/inductiveautomation/original/1X/d23659b203d2d24d394be983a52adb2fa6fe23d4.gif "Mr. Green")
