title: Debugging Popen subprocesses with PyCharm
body: <p>I'm trying to debug a Python application that uses psutil.Popen objects. When I start a subprocess, PyCharm replaces my command line with the following:</p>
  
  <pre><code>python -m pydevd.py --multiproc --client 127.0.0.1 --port 52581 --file &lt;myapplication&gt;
  </code></pre>
  
  <p>which ends up in an error:</p>
  
  <pre><code>python.exe: Import by filename is not supported.
  </code></pre>
  
  <p>When I launch the same command without <code>-m</code> option, everything seems to be fine. Is there a way I can change PyCharm's debugger launch command?</p>
  
  <p>I've updated to PyCharm Community Edition 4.0.3 and the new debugger command looks like:</p>
  
  <pre><code>python.exe "C:\Program Files (x86)\JetBrains\PyCharm Community Edition 4.0.3\helpers\pydev\pydevd.py" 
  --multiproc --client 127.0.0.1 --port 62661 
  --file __main__.py local -c local.yml -f input/11_12.xls
  </code></pre>
  
  <p>where <code>-c</code> and <code>-f</code> are my module's command line arguments. The debugger launch command has changed, but it didn't solve the issue; I still get the <code>Import by filename is not supported</code> error.</p>
  
  <p>A code example is available <a href="https://bitbucket.org/lgyanf/pycharm-multiprocess-debug">here at Bitbucket.org</a>.
  Pycharm's run configuration should look like:</p>
  
  <pre><code>Script:            __main__.py
  Script parameters: server
  Working directory: %path to the repository%
  </code></pre>