# Unable to use an imported module

**URL:** <https://forum.inductiveautomation.com/t/unable-to-use-an-imported-module/17167>\
**Category:** Module Development\
**Created:** [February 28, 2018, 4:53pm UTC](https://forum.inductiveautomation.com/t/unable-to-use-an-imported-module/17167 "2018-02-28T16:53:26Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![patrick.garceau](https://avatars.discourse-cdn.com/v4/letter/p/76d3ee/32.png) [@patrick.garceau](https://forum.inductiveautomation.com/u/patrick.garceau)\
**Post date:** [February 28, 2018, 4:53pm UTC](https://forum.inductiveautomation.com/t/unable-to-use-an-imported-module/17167/1 "2018-02-28T16:53:26Z")

</div>

I have created a module.xml using the documentation that has one jar inside as gz using the Pack200 application.

I am unable to create a script that is using an import statement for that class.

error is : ImportError: No module named xxx

What have I done wrong?

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [February 28, 2018, 5:15pm UTC](https://forum.inductiveautomation.com/t/unable-to-use-an-imported-module/17167/2 "2018-02-28T17:15:41Z")

</div>

What scope did you load the jar into and what scope is your test script in?

---

<div class="post-metadata">

**Author:** ![patrick.garceau](https://avatars.discourse-cdn.com/v4/letter/p/76d3ee/32.png) [@patrick.garceau](https://forum.inductiveautomation.com/u/patrick.garceau)\
**Post date:** [February 28, 2018, 5:34pm UTC](https://forum.inductiveautomation.com/t/unable-to-use-an-imported-module/17167/3 "2018-02-28T17:34:08Z")

</div>

scope = “GDC”

and i’m using the Script console from the designer, that’s the only way I know to test a script before implementing it somewhere.

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [February 28, 2018, 5:35pm UTC](https://forum.inductiveautomation.com/t/unable-to-use-an-imported-module/17167/4 "2018-02-28T17:35:59Z")

</div>

You might try loading it just in CD for now and see if that changes anything. Gateway scope should get its own separate entry that isn’t packed.

If not, we’ll need more information… maybe show us what your module.xml looks like, confirm that your module is being loaded with some logging statements, tell us about the jar you’re loading, show us the script, etc…

---

<div class="post-metadata">

**Author:** ![patrick.garceau](https://avatars.discourse-cdn.com/v4/letter/p/76d3ee/32.png) [@patrick.garceau](https://forum.inductiveautomation.com/u/patrick.garceau)\
**Post date:** [February 28, 2018, 5:56pm UTC](https://forum.inductiveautomation.com/t/unable-to-use-an-imported-module/17167/5 "2018-02-28T17:56:42Z")

</div>

So, modified the module and change the scope to CD, imported the module ok

 ![](https://us1.discourse-cdn.com/inductiveautomation/original/2X/6/685e54df5f790a848bd9c76c76a55a3cae03596f.png)

in the script console, simple script to see if module exists:  
 ![](https://us1.discourse-cdn.com/inductiveautomation/original/2X/a/a1fe192cd33c3dc65ffa4b1ec5e63120fe78f769.png)

So, no luck.

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [February 28, 2018, 5:57pm UTC](https://forum.inductiveautomation.com/t/unable-to-use-an-imported-module/17167/6 "2018-02-28T17:57:55Z")

</div>

That 0kb length in the log message is suspicious…

---

<div class="post-metadata">

**Author:** ![patrick.garceau](https://avatars.discourse-cdn.com/v4/letter/p/76d3ee/32.png) [@patrick.garceau](https://forum.inductiveautomation.com/u/patrick.garceau)\
**Post date:** [February 28, 2018, 6:22pm UTC](https://forum.inductiveautomation.com/t/unable-to-use-an-imported-module/17167/7 "2018-02-28T18:22:51Z")

</div>

saw that too, not sure what that means.

So, the jar is compressed using pack200 from Oracle.  
The module.xml is using the gz as jar.

When I tried using the jar in the jar section, it didn’t work. the jar is 80Mb.

I will try creating a simple class and see if I can use it in ignition.

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [February 28, 2018, 7:10pm UTC](https://forum.inductiveautomation.com/t/unable-to-use-an-imported-module/17167/8 "2018-02-28T19:10:52Z")

</div>

If the resulting .modl file isn’t also many megabytes in size something is going wrong with your build process. How are you building it?

---

<div class="post-metadata">

**Author:** ![patrick.garceau](https://avatars.discourse-cdn.com/v4/letter/p/76d3ee/32.png) [@patrick.garceau](https://forum.inductiveautomation.com/u/patrick.garceau)\
**Post date:** [February 28, 2018, 7:29pm UTC](https://forum.inductiveautomation.com/t/unable-to-use-an-imported-module/17167/9 "2018-02-28T19:29:20Z")

</div>

I have created a new project in Eclipse with one class in it and was able to create the module, import it and use it using the import statement and the call itself.

Noted that I need to call using the full statement of the jar file… x.x.x.proc();

So, a module is working.

I will create what i need for a function call and include that new jar into Ignition and use it as such. There is a depends switch in the module.xml that I might need to use.

Probably started this too far, lets go step by step.

Thanks for the help.
