# Import Error on Gateway Scripting (no module named client)

**URL:** <https://forum.inductiveautomation.com/t/import-error-on-gateway-scripting-no-module-named-client/81989>\
**Category:** Ignition\
**Tags:** scripting\
**Created:** [November 16, 2023, 3:09pm UTC](https://forum.inductiveautomation.com/t/import-error-on-gateway-scripting-no-module-named-client/81989 "2023-11-16T15:09:41Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Almir\_A\_Braggio](https://avatars.discourse-cdn.com/v4/letter/a/43a26b/32.png) [@Almir\_A\_Braggio](https://forum.inductiveautomation.com/u/Almir_A_Braggio)\
**Post date:** [November 16, 2023, 3:09pm UTC](https://forum.inductiveautomation.com/t/import-error-on-gateway-scripting-no-module-named-client/81989/1 "2023-11-16T15:09:41Z")

</div>

Hello,

I call a gateway scripting from a tag change event gateway, and inside this script I call a web service function using Sepasoft Web Services (Project MESGateway).  
My problem is to import the function GatewayException lik this example:

`import` `com.inductiveautomation.ignition.client.gateway_interface.GatewayException as GatewayException`

Reference: [Timeout Exception in RESTful Applications 3.0 - Knowledge Base - Sepasoft MES Help Documentation](https://help.sepasoft.com/docs/display/SKB/Timeout+Exception+in+RESTful+Applications+3.0)

Running with gateway scripts (Gateway Scope), when occurrs a exception, I receive an error like:  
ImportError: Error loading module: Traceback line 2, in ImportError: No module named client

But, using Scripting Console, the same python script, this import works.  
Any idea?

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [November 16, 2023, 4:16pm UTC](https://forum.inductiveautomation.com/t/import-error-on-gateway-scripting-no-module-named-client/81989/2 "2023-11-16T16:16:46Z")

</div>

The script console is running on your local machine where the designer is - so it's the "designer" scope. When you're running on the gateway scope, you have access to a totally different set of Java libraries and imports.

That Sepasoft article is suggesting you import the 'GatewayException' class (under the `client` package) because that's how exceptions thrown by code on the gateway are delivered to the designer and client scopes - wrapped up into `GatewayException` instances.

In a script running entirely on the gateway, there's no need for that indirection, because you'll have direct access to whatever exception is being thrown. Simply stop trying to catch it/importing `GatewayException` in the wrong scope and see what actual timeout exception is being thrown, and adjust your gateway side code to catch _that_ exception.
