title: Running A Python Script In Jenkins Pipeline Shell
body: <p>I'm having an issue to where I can't seem to run a python script in a Jenkins Pipeline script.</p>
  <p>If I create a Jenkins Freestyle job and execute a shell with:</p>
  <pre><code>#!/usr/bin/env python
  import boto3
  </code></pre>
  <p>The import works and I can run the rest of my python code.</p>
  <p>But if I create a Jenkins Pipeline and try to run the following:</p>
  <pre><code>pipeline {
      agent { label 'master' }
      stages {
          stage('job') {
              steps {
                  sh '''
                      #!/usr/bin/env python
                      import boto3
                  '''
              }
          }
      }
  }
  </code></pre>
  <p>I get <code>import: command not found</code></p>
  <p>Do I need to set the env some other way?</p>
  <p>UPDATE:</p>
  <p>So I tried this:</p>
  <pre><code>pipeline {
      agent { label 'master' }
      stages {
          stage('job') {
              steps {
                  sh '''#!/usr/bin/env python
                  import boto3
                  '''
              }
          }
      }
  }
  </code></pre>
  <p>And now I'm getting an indent error.</p>
  <p>I've tried indenting it a millions ways with no luck.</p>
  <p>When I run the above without the import boto3 the job runs fine.</p>
  <p>I also checked out the snippet generator on the Jenkins severs and read this:</p>
  <p>&quot;An interpreter selector may be used, for example: #!/usr/bin/perl&quot;</p>
  <p>UPDATE</p>
  <p>The following works:</p>
  <pre><code>pipeline {
      agent { label 'master' }
      stages {
          stage('job') {
              steps {
                  sh '''#!/usr/bin/env python \n''' +
                  '''import boto3'''
              }
          }
      }
  }
  </code></pre>
  <p>The only issue is having to to the \n and + after every line seems a bit too much...there has to be another way</p>