title: Running PIP install with pythonw makes console scripts use pythonw instead of python
body: <p>(windows 7 pro, python 2.7, PIP 9.0.1)</p>
  
  <p>During the deployment process of our tools on client workstations, I use <code>pip</code> to install custom python libs. Because of the way it is packaged, I cannot have a <code>pip.exe</code>, so I run the <code>pip</code> module with <code>pythonw</code> to avoid the popping of a console.</p>
  
  <pre><code>$ c:\installdir\pythonw.exe -m pip install mylib --index http://pypi.intranet.org
  </code></pre>
  
  <p><code>mylib</code> has a console entrypoint (let's call it <code>mylibutil</code>) defined in the <code>setup.py</code> file. So a <code>mylibutil.exe</code> is generated at install time which is fine.</p>
  
  <p>But when I run it, nothing happens in my console. After parsing the content of the generated executable, I saw that the python used to run the script is <code>c:\installdir\pythonw.exe</code>, so not the correct one for a console script, but indeed the same one that was used when calling PIP.</p>
  
  <p>Is there any workaround? Is this a win-specific bug of PIP?</p>
  
  <p>I can use <code>python</code> instead of <code>pythonw</code> at install time, that would be alright, but I know the popping consoles can frighten some of the users sometimes.</p>
  
  <blockquote>
    <p><strong>NOTE</strong>: I found <a href="https://superuser.com/questions/140047/how-to-run-a-batch-file-without-launching-a-command-window">this trick</a> to wrap my python call through a no-console VBS script. So that's a workaround. However, I'd like it to keep things simpler if possible.</p>
  </blockquote>