Python Operator is not able to load Dependency module from another Folder

Python Operator is not able to load Dependency module from another Folder

book

Article ID: KB0072747

calendar_today

Updated On:

Products Versions
TIBCO Streaming 10.6.1

Description

I have python script that i am able to execute as standalone script when i execute that from command line it resolve all dependency module that is located inĀ  <project folder>/src/main/resource , But when i try to execute the same script from Python operator its not able to resolve the dependency module from another folder .

Resolution

To resolve the model dependency issue we add below lines with each python script.

import sys

sys.path.append(r'path_to_your_project_module')

Adding this line allows StreamBase to see the required folder and access all files inside it.

Issue/Introduction

Add path using sys.path.append(r'path_to_your_project_module')