ImportError: Error loading module getVolt: No module named f

Hi,
I have this import statement defined at the beginning of script in project’s script module

global system, app, time, sys, fnmatch
import system, app, time, sys, fnmatch

It works fine in designer preview and script playground. However, I got an error in gateway console that it has error loading module during client runtime.
Do anyone have any idea how can I solve the problem?

2014-05-21 11:22:09 PM TagChangeScriptManager Error executing tag change script: Maginit/sendToolCommand
Traceback (most recent call last):
File “TagChangeScript:Maginit/sendToolCommand”, line 12, in
ImportError: Error loading module getVolt: No module named fnmatch

Our gateway version is 7.6.6 (b2014040112)
Java Sun Microsystems Inc. 1.6.0_24

I have the same problem with another module created by me.

How you solve this problem?

Andrea

This should be fixed in version 7.8.1

I'm seeing a similar Import Error on 7.9.4

Details are a little different...

The error occurs when I attempt to execute a global script from the Script Console / Designer / Client.

Script functionality was validated by copying into the script console and running locally.

Function:

def test():
     return 'TEST'

** Also present in shared.Company.utils

Trial 1:

test()

Returns:

'TEST'

Trial 2:

shared.Company.utils.test()

Error:

Traceback (most recent call last):
File "", line 31, in
ImportError: Error loading module utils: IndentationError: ('unindent does not match any outer indentation level', ('module:shared.Company.utils', 96, 4, ' header = ["value", "display"]\n'))

Action Items:

  • Restart Designer
  • Delete C:\Users<My User ID>.ignition cache folder, Restart Designer
  • Reboot, Restart Designer
  • Restart Gateway
  • Clear Browser Cache
  • Clear Java Cache

Your error is here, and it's almost, but not quite, entirely unlike the OP's error:

You have inconsistent indentation in your script.

3 Likes