On 6/9/2023 1:43 PM, Dennis Lee Bieber via Python-list wrote:
On Thu, 8 Jun 2023 17:22:22 -0400, Thomas Passin <[email protected]> declaimed the following:On 6/8/2023 3:14 PM, Dennis Lee Bieber via Python-list wrote: C:\Users\Owner>-=-=- Windows PowerShell Copyright (C) Microsoft Corporation. All rights reserved. Try the new cross-platform PowerShell https://aka.ms/pscore6 PS C:\Users\Owner> Get-ChildItem -Path C:\Python310\ -Recurse -Name -Filter "pip.*" Lib\site-packages\pip Lib\site-packages\pipenv\patched\pip Lib\site-packages\pipenv\utils\pip.py Lib\site-packages\pipenv\utils\__pycache__\pip.cpython-310.pyc PS C:\Users\Owner> -=-=- I've just run the installer -- python-3.10.11-amd64.exe -- as admin, in "repair" mode! There is NO pip.exe under the Python install directory.It's in the Scripts directory: C:\Users\tom\AppData\Local\Programs\Python\Python311\Scripts\pip3.exe
I copied the wrong line of my output - pip.exe is in the same place as pip3.exe.
Note that this installation was made for a single user, not "All Users" - this is an install-time option. For an "All Users" location (I happened to install 3.9 for "All Users"), it does go into %PROGRAMFILES%:I always install in "All Users" mode, but specify a directory that is NOT under "Program Files" -- in this case, C:\Python310 The PowerShell command recurses into all subdirectories of the -path argument. As it shows, the ONLY "pip" found is the actual library module. PS C:\Users\Owner> Get-ChildItem -Path C:\P*\ -Recurse -Name -Filter "pip.*" R\R-4.2.3\library\climextRemes\pip R\R-4.2.3\library\vICC\help\figures\pip.png Package Cache\{5C3F818F-9EF5-444C-9386-77A0063A383A}v3.10.11150.0\pip.msi Package Cache\{861EF849-90A5-4F4A-BAD4-479141466551}v3.10.10150.0\pip.msi Lib\site-packages\pip Lib\site-packages\pipenv\patched\pip Lib\site-packages\pipenv\utils\pip.py Lib\site-packages\pipenv\utils\__pycache__\pip.cpython-310.pyc PS C:\Users\Owner> Get-ChildItem -Path C:\P*\ -Recurse -Name -Filter "pip*.exe" Common Files\Microsoft Shared\ink\pipanel.exe {F87E77CE-BAA2-49E1-AAE3-1F6B2704ABAA}\OFFLINE\8AFA5EE\A9DCCED0\Pipe.exe PS C:\Users\Owner> Two variations, both now including "Program Files" (and x86), "ProgramData", and the Python install; one looking for "pip<dot><anything>", the other "pip<anything><dot>exe". Again, nothing found except the library module. "ensurepip" appears to only verify that the library module is installed and does not seem to look for any .exe or other convenience access file. PS C:\Users\Owner> python -m ensurepip Looking in links: c:\Users\Owner\AppData\Local\Temp\tmp0cr7yu4s Requirement already satisfied: setuptools in c:\python310\lib\site-packages (67.6.1) Requirement already satisfied: pip in c:\python310\lib\site-packages (23.0.1) PS C:\Users\Owner>
The standard python.org installs pip.exe in the Scripts directory and a pip folder in the Lib\site-packages directory. The pip directory does not include an actual file named "pip.py", but through Python invocation magic (involving __main__), py -m pip finds the right entry point and runs what you want.
We can find pip.exe using good old-fashioned dir (we don't need any new-fangled Powershell):
C:\Users\tom>dir AppData\Local\Programs\Python /Aa /S /W /B |find "pip"|find "Scripts"
C:\Users\tom\AppData\Local\Programs\Python\Python310\Scripts\pip.exe C:\Users\tom\AppData\Local\Programs\Python\Python310\Scripts\pip3.10.exe C:\Users\tom\AppData\Local\Programs\Python\Python310\Scripts\pip3.exe C:\Users\tom\AppData\Local\Programs\Python\Python310\Scripts\pipx.exe C:\Users\tom\AppData\Local\Programs\Python\Python311\Scripts\pip.exe C:\Users\tom\AppData\Local\Programs\Python\Python311\Scripts\pip3.11.exe C:\Users\tom\AppData\Local\Programs\Python\Python311\Scripts\pip3.exe C:\Users\tom\AppData\Local\Programs\Python\Python37\Scripts\pip.exe C:\Users\tom\AppData\Local\Programs\Python\Python37\Scripts\pip3.10.exe C:\Users\tom\AppData\Local\Programs\Python\Python37\Scripts\pip3.7.exe C:\Users\tom\AppData\Local\Programs\Python\Python37\Scripts\pip3.exe Searching for a "pip" directory:C:\Users\tom>dir AppData\Local\Programs\Python /Ad /S /W /B |find "pip" |find /V "_"
C:\Users\tom\AppData\Local\Programs\Python\Python310\Lib\ensurepip C:\Users\tom\AppData\Local\Programs\Python\Python310\Lib\site-packages\pip C:\Users\tom\AppData\Local\Programs\Python\Python310\Lib\site-packages\pip-23.1.dist-info C:\Users\tom\AppData\Local\Programs\Python\Python310\Lib\site-packages\pipx C:\Users\tom\AppData\Local\Programs\Python\Python310\Lib\site-packages\pipx-1.1.0.dist-info C:\Users\tom\AppData\Local\Programs\Python\Python310\Lib\site-packages\mypy\typeshed\stdlib\ensurepip C:\Users\tom\AppData\Local\Programs\Python\Python310\Lib\site-packages\mypy\typeshed\stdlib\@python2\ensurepip C:\Users\tom\AppData\Local\Programs\Python\Python310\Lib\site-packages\pipx\commands C:\Users\tom\AppData\Local\Programs\Python\Python310\Lib\site-packages\win32\Demos\pipes C:\Users\tom\AppData\Local\Programs\Python\Python311\Lib\ensurepip C:\Users\tom\AppData\Local\Programs\Python\Python311\Lib\site-packages\pip C:\Users\tom\AppData\Local\Programs\Python\Python311\Lib\site-packages\pip-23.1.2.dist-info C:\Users\tom\AppData\Local\Programs\Python\Python37\Lib\ensurepip C:\Users\tom\AppData\Local\Programs\Python\Python37\Lib\site-packages\pip C:\Users\tom\AppData\Local\Programs\Python\Python37\Lib\site-packages\pip-22.3.1.dist-info C:\Users\tom\AppData\Local\Programs\Python\Python37\Lib\site-packages\win32\Demos\pipesA little hard to read but it does find the site-packages pip directory. If you have a grep or awk available, you could use it instead of find to make the output more concise. Or if you have grep or awk and don't mind waiting a little longer for the results:
C:\Users\tom>dir AppData /Ad /S /W /B |awk "/\\pip$/ {print $1}"
C:\Users\tom\AppData\Local\pip
C:\Users\tom\AppData\Local\Programs\Python\Python310\Lib\site-packages\pip
C:\Users\tom\AppData\Local\Programs\Python\Python311\Lib\site-packages\pip
C:\Users\tom\AppData\Local\Programs\Python\Python37\Lib\site-packages\pip
C:\Users\tom\AppData\Roaming\Python\Python39\site-packages\pip
and, with grep:
C:\Users\tom>dir AppData /Aa /S /W /B |agrep "pip.exe"
C:\Users\tom\AppData\Local\Programs\Python\Python310\Scripts\pip.exe
C:\Users\tom\AppData\Local\Programs\Python\Python311\Scripts\pip.exe
C:\Users\tom\AppData\Local\Programs\Python\Python37\Scripts\pip.exe
C:\Users\tom\AppData\Roaming\Python\Python310\Scripts\pip.exe
C:\Users\tom\AppData\Roaming\Python\Python39\Scripts\pip.exe
Grand Total: 5 match(es) found.
--
https://mail.python.org/mailman/listinfo/python-list
