如何使用Informatica命令任务运行Python代码 [英] How can I run Python code using Informatica command tasks
问题描述
我正在尝试使用Informatica命令任务运行Python脚本以从Web抓取数据.每次启动工作流程时,都会收到错误消息:
I'm attempting to run a Python script using an Informatica command task to scrape data from the web. Each time I start the workflow I get the error:
命令任务实例[c_Run_Code]:使用退出代码[1]未能成功完成命令[Test_Scrape]的执行
Command task instance [c_Run_Code]: execution of command [Test_Scrape] did not complete successfully with exit code [1]
我正在使用哈希爆炸:#!C \ Python27 \ python.exe
作为代码的第一行,而我发出的命令是:
I'm using the hash-bang: #!C\Python27\python.exe
as the first line in the code, and the command I'm issuing is:
C\Python27\python.exe C\Documents\Python\Test_Scrape.py
为什么我不断出现此错误?
Why do I continuously get this error?
推荐答案
我已经找到并解决了这个问题.对于希望执行类似操作的用户:将命令包装在批处理文件或powershell文件中,或者确保已将安装的python版本添加到PATH中.
I have found and fixed the problem. For those wishing to do something similar: either wrap the command in a batch or powershell file, or ensure that the python version installed has been added to the PATH.
这篇关于如何使用Informatica命令任务运行Python代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!