Why does Pip documentation refer Windows to use an executable named "py"?
See original GitHub issueDescription
I’m trying to follow user guides on getting pip development done and one of the things I notice is that it refers to executing python through an executable called py
.
I run Python almost exclusively on Windows and I don’t know what py
is, I can’t google it because “py” or “python py” or “py executable” are all too generic for Google so I can’t find any documentation on it, instead Google thinks I’m talking about the “.py” extension.
I think it’s something that ships optionally with the Python installer from the Python Foundation? But if so it’s optional as I’ve never had it installed. But even so I don’t think it ships with the Python from the Windows store, or the Python in Anaconda, Miniconda, Miniforge, Mambaforge, etc…
So why is pip referring to py
which is this optional thing that’s impossible to find documentation on rather than just python
which is what works on both Windows and other platforms?
Expected behavior
python
pip version
all
Python version
all
OS
Windows
How to Reproduce
Read Documentation
Output
No response
Code of Conduct
- I agree to follow the PSF Code of Conduct.
Issue Analytics
- State:
- Created 2 years ago
- Comments:20 (20 by maintainers)
Top GitHub Comments
py
is the Python launcher, and it’s covered in the documentation.It’s the recommended way of running Python on Windows, not just by pip, but in general, precisely because the
python
command does not work consistently (it’s not installed on PATH by default in the python.org installers, it doesn’t behave the same as on Unix, wherepython
runs Python2, and you needpython3
to run Python 3, etc).The pip documentation is written for users of “standard” Python, so what Anaconda does is not really relevant (apart from anything else, if you’re using Anaconda you should be using
conda
, not pip, anyway). The Windows Store Python is an oddball, which doesn’t work the “standard” way. I don’t know why they chose to work differently, but frankly it’s just made things more complicated than they already were 🙁Basically the answer is “it’s all a complicated mess, and nothing works properly across all possible distributions/environments”. The most likely thing to work by far on Windows has always been
py
, so that’s what we document.If someone wants to improve the documentation to explain all of this complexity, then I’d be fine with someone having a go. But you should look at the history fist - this has all been thrashed out many times in the past. Circumstances do change, so that’s not saying we won’t change the docs, but in my personal opinion, things haven’t changed enough yet to make that worthwhile.
This is not really a pip issue, but I’m wondering if Windows Store apps allow for requesting dependencies. If it’s somewhat possible, I’d rather much prefer CPython to officially distribute
py
in the Store that gets installed when any Python version is installed. Thepy
command made calling Python on Windows much easier for newcomers, and it’s very disappointing that CPython is now effectively breaking their own good idea and actively confusing everyone.