'ImportError: cannot import name from (unknown location)' error when running python based abx actions
search cancel

'ImportError: cannot import name from (unknown location)' error when running python based abx actions

book

Article ID: 314905

calendar_today

Updated On:

Products

VMware Aria Suite

Issue/Introduction

Symptoms:
  • Running python based abx actions fails in Aria Automation with a stack trace similar to:
Traceback (most recent call last): File "<filename>", line <line no>,
in main f = import_function(<functionName>(), sys.argv[1]) File "<filename>", line <line no>,
in import_function module = importlib.import_module(mod_name) File "/usr/lib/python3.7/importlib/__init__.py", line <line no>,
in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line <line no>,
in _gcd_import File "<frozen importlib._bootstrap>", line <line no>,
in _find_and_load File "<frozen importlib._bootstrap>", line <line no>,
in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line <line no>,
in _load_unlocked File "<frozen importlib._bootstrap_external>", line <line no>,
in exec_module File "<frozen importlib._bootstrap>", line <line no>,
in _call_with_frames_removed File "/function/handler.py", <line no>,
in <module> from <module> import  File "<PathtoFile>.py", <line no>,
in <module> from <module> import ( ImportError: cannot import name '<filename>' from '<module>' (unknown location)
  • The action package was created and zipped on a Windows or macOS machine

 


Environment

VMware Aria Automation 8.x

Cause

The issue occurs when the action package is created on a Windows or macOS machine which causes compatibility issues.

Resolution

To resolve the issue create and zip the action package on a linux server.