title: Error trying to execute a Python2 binary from within a Python3 subprocess
body: <p>I am trying to execute my Python3 script that calls a python binary with python2.7 lib file dependencies. The binary is pretty old, not by me and trying to bring it into Python3 is a big undertaking.</p>
  <p>My system build is Win10 running Ubuntu WSL. I am executing my puthon3 code inside Ubuntu WSL, so essential I am executing straight off the Linux terminal.</p>
  <p>By hand on the terminal, I can get the binary working fine by creating a virtual environment for python2 and execute the binary as such:</p>
  <pre><code>source ../martini_3.0.b.3.2/PythonCrisis/bin/activate
  ../martini_3.0.b.3.2/martinize -h
  deactivate
  </code></pre>
  <p>I decided to put this in a shell (.sh) file (inc. #!/bin/bash) and execute it from the Ubuntu terminal. No problem at all. However, I want to take this single step and execute it from within a Python3 script.</p>
  <p>Unfortunately, I'm running into some problems. My Python 3 code looks like this:</p>
  <pre><code>import subprocess
  
  result = subprocess.run([&quot;/home/ubuntu/DE_NOVO_PROTEINS/SCRIPTS/martini_shell.sh&quot;], capture_output=True, text=True)
  print(&quot;stdout&quot;, result.stdout)
  print(&quot;stderr&quot;, result.stderr)
  </code></pre>
  <p>I get the following:</p>
  <pre><code>stdout
  stderr /home/ubuntu/DE_NOVO_PROTEINS/SCRIPTS/martini_shell.sh: 3: source: not found
  Traceback (most recent call last):
    File &quot;/home/ubuntu/miniconda3/lib/python3.8/runpy.py&quot;, line 194, in _run_module_as_main
      return _run_code(code, main_globals, None,
    File &quot;/home/ubuntu/miniconda3/lib/python3.8/runpy.py&quot;, line 87, in _run_code
      exec(code, run_globals)
    File &quot;../martini_3.0.b.3.2/martinize/__main__.py&quot;, line 3, in &lt;module&gt;
    File &quot;&lt;frozen zipimport&gt;&quot;, line 259, in load_module
    File &quot;../martini_3.0.b.3.2/martinize/martinize/__init__.py&quot;, line 37, in &lt;module&gt;
  ModuleNotFoundError: No module named 'core'
  DeprecationWarning: 'source deactivate' is deprecated. Use 'conda deactivate'.
  </code></pre>
  <p>Firstly, it looks like the shell script isn't being found. However, I suspect it's a little bit more complicated than that (given that the file <strong>does</strong> exist). Suggestions are very much appreciated.</p>
  <p><strong>EDIT</strong>
  Firstly, I want to stress that I am not trying to run a python2 interpreter. I am not executing python2 code. I'm executing a binary that depends on python2.7 libraries.</p>
  <p><strong>SOLVED</strong>
  I solved it. I only had to change #!/bin/sh to #!/bin/bash</p>