title: Intellij/Pycharm can't debug Python modules
body: <p>I use <strong>PyCharm</strong>/<strong>IntelliJ</strong> community editions from a wile to write and debug Python scripts, but now I'm trying to debug a <strong>Python module</strong>, and PyCharm does a wrong command line instruction parsing, causing an execution error, or maybe I'm making a bad configuration.</p>
  
  <p>This is my run/debug configuration:</p>
  
  <p><img src="https://i.stack.imgur.com/Jrddy.png" alt="IntelliJ run/debug Python module configuration"></p>
  
  <p>And this is executed when I run the module (no problems here):</p>
  
  <pre><code>/usr/bin/python3.4 -m histraw
  </code></pre>
  
  <p>But when I debug, this is the output in the IntelliJ console:</p>
  
  <pre><code>/usr/bin/python3.4 -m /opt/apps/pycharm/helpers/pydev/pydevd.py --multiproc --client 127.0.0.1 --port 57851 --file histraw
  /usr/bin/python3.4: Error while finding spec for '/opt/apps/pycharm/helpers/pydev/pydevd.py' (&lt;class 'ImportError'&gt;: No module named '/opt/apps/pycharm/helpers/pydev/pydevd')
  
  Process finished with exit code 1
  </code></pre>
  
  <p>As you can see, the parameters are wrong parsed, and after <code>-m</code> option a IntelliJ debug script is passed before the module name.</p>
  
  <p>I also tried just put <code>-m histraw</code> in the <em>Script</em> field, but doesn't work, that field is only to put Python script paths, not modules.</p>
  
  <p>Any ideas?</p>