title: Running a python script through a windows batch file using ExecuteStreamCommand NIFI
body: <p>I understand that this question may have been repeated many times before - I am new to Nifi and unfortunately none of the previous answers worked for me.</p>
  <p>I am trying to run a simple python script using the <a href="https://nifi.apache.org/docs/nifi-docs/components/org.apache.nifi/nifi-standard-nar/1.6.0/org.apache.nifi.processors.standard.ExecuteStreamCommand/index.html" rel="nofollow noreferrer"><code>ExecuteStreamCommand</code></a> processor (in Windows 10). However, I cannot call the python script directly from Nifi as it requires the conda environment to be activated (it gives me an import error for python packages- the same happens when the script is called from both nifi and command prompt).</p>
  <p>I have since written a basic batch script to activate the conda environment and run the python script (see below).</p>
  <p>activate.bat</p>
  <pre><code>CALL conda activate base   
  python sample.py
  CALL conda deactivate
  </code></pre>
  <p>This works well and produces the output I need when run from the command line. However, calling the bat file from Nifi does not seem to do anything. It does not generate an error (simply pass the incoming flowfile to output with the working directory added to each line of the incoming csv file).</p>
  <p>The config in Nifi:</p>
  <ul>
  <li><p>Command Arguments: C:\Temp\activate.bat</p>
  <p>Command Path: C:\Windows\System32\cmd.exe</p>
  </li>
  </ul>
  <p>Any help would be greatly appreciated.</p>