user12197400
user12197400

Reputation:

Python script through SSIS

This is how I am executing my python from Execute process in SSIS: I have the same command in .bat file and I can execute .bat from SSIS execute task but if I put the whole command like above it doesn't work. Any help is appreciated. Error I get is The process exit code was "2" while the expected was "0".I have attached the screenshot of my SSIS executeprocess taskenter image description here

C:/Users/datadude/AppData/Local/Continuum/miniconda3/envs/ra_platform-201909/python.exe e:/Source/Scripts/Python/rapc/kozuchi/core/qc/solactive_returns_qc.py --datasource solactive

Upvotes: 0

Views: 775

Answers (1)

predmod
predmod

Reputation: 429

As comment from Nick.McDemaid says - to get proper help you need to provide better diagnostics. Try running it in Debug mode in SSIS as Execute container first and show the errors output? Here is a shot at an answer though, maybe it will help others.

I think the problem is in the way you use quotes in the Arguments field. The Arguments field is treated somewhat surprisingly by SSIS. In my tests it was always quoted (extra surrounding quotes added by SSIS) when passed as an argument to the command (Executable) of the execute process task. I had similar problem when I was trying to evaluate a variable to be passed as an extra argument to a python script (i.e. part of the arguments field). The whole Arguments string was quoted and variable not evaluated.

The solution (to my problem) was to use Expressions (third option on the left in the dialog), and select Arguments as an expression. Then the Arguments expression was fully flexible. In your case I think you do not need the quotes, or should try building the Arguments as an expression.

Upvotes: 0

Related Questions