Note that I've observed the following problem with any Python package containing a "console_script" entry point. For the reproducer I've randomly chosen pipdeptree
Is seems as if pip (or some other layer?) uses sys.executable instead of "python" for the console scripts. Version info:
PS E:\temp> .\Visible\Scripts\pip --version
pip 23.2.1 from E:\temp\Visible\Lib\site-packages\pip (python 3.11)
Why would this problem be relevant? I constructed an internal tool to keep virtual environments up-to-date, essentially calling pip install --upgrade. What we want/need is that this updating also takes place on Windows machines if the user isn't currently logged in. Starting a scheduled task with user credentials is easy but then we need to call "pythonw": "python" fails because it cannot show the console windows. What we noticed now is that scripts of packages that were upgraded by this automatic tasks suddenly didn't show console output anymore
Problem description
Note that I've observed the following problem with any Python package containing a "console_script" entry point. For the reproducer I've randomly chosen pipdeptree
Let's start with the non-broken case:
When I do the same with pythonw the installed script doesn't show anything:
Looking into the generated .exes with a WSL shell I can also see the problem:
Is seems as if pip (or some other layer?) uses sys.executable instead of "python" for the console scripts. Version info:
Why would this problem be relevant? I constructed an internal tool to keep virtual environments up-to-date, essentially calling
pip install --upgrade
. What we want/need is that this updating also takes place on Windows machines if the user isn't currently logged in. Starting a scheduled task with user credentials is easy but then we need to call "pythonw": "python" fails because it cannot show the console windows. What we noticed now is that scripts of packages that were upgraded by this automatic tasks suddenly didn't show console output anymore