Running PIP install with pythonw makes console scripts use pythonw instead of python

1.2k Views Asked by At

(windows 7 pro, python 2.7, PIP 9.0.1)

During the deployment process of our tools on client workstations, I use pip to install custom python libs. Because of the way it is packaged, I cannot have a pip.exe, so I run the pip module with pythonw to avoid the popping of a console.

$ c:\installdir\pythonw.exe -m pip install mylib --index http://pypi.intranet.org

mylib has a console entrypoint (let's call it mylibutil) defined in the setup.py file. So a mylibutil.exe is generated at install time which is fine.

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 c:\installdir\pythonw.exe, so not the correct one for a console script, but indeed the same one that was used when calling PIP.

Is there any workaround? Is this a win-specific bug of PIP?

I can use python instead of pythonw at install time, that would be alright, but I know the popping consoles can frighten some of the users sometimes.

NOTE: I found this trick 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.

0

There are 0 best solutions below