Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Assistance Request - Issue with Installing 'pip' despite Python 3.10 Installation

35 views
Skip to first unread message

Florian Guilbault

unread,
Jun 7, 2023, 11:37:14 AM6/7/23
to
Dear Python Technical Team,

I hope this email finds you well. I am reaching out to you today to seek
assistance with an issue I am facing regarding the installation of 'pip'
despite my numerous attempts to resolve the problem.

Recently, I performed installation, uninstallation, and even repair
operations on Python 3.10 on my computer. However, I have noticed that
'pip' has never been installed successfully. When I check via the command
prompt, I receive the following error: "'pip' is not recognized as an
internal or external command, operable program, or batch file."

I have tried several approaches to resolve this issue. I have verified that
the PATH environment variable is correctly configured to include the path
to the Python Scripts directory. I have also attempted to run the
'get-pip.py' installation script from the command line, but it did not work
either.

I am aware that 'pip' is typically installed automatically with Python, but
I am encountering this persistent difficulty. Therefore, I would like to
request your assistance and expertise in resolving this 'pip' installation
issue. I would like to be able to use 'pip' to manage my Python packages
efficiently.

I am open to any suggestions and steps you can provide to help me resolve
this problem. Please note that I am a user on the Windows operating system.

Thank you sincerely for your attention and support. I eagerly await your
guidance to resolve this situation.

Best regards,

Barry

unread,
Jun 7, 2023, 11:44:17 AM6/7/23
to


> On 7 Jun 2023, at 16:39, Florian Guilbault via Python-list <pytho...@python.org> wrote:
>
> Dear Python Technical Team,
You can run pip like this, that works with needing to mess with your PATH.

py -m pip

Barty


>
> Best regards,
> --
> https://mail.python.org/mailman/listinfo/python-list
>

MRAB

unread,
Jun 7, 2023, 12:09:13 PM6/7/23
to
On 2023-06-07 15:54, Florian Guilbault via Python-list wrote:
> Dear Python Technical Team,
>
> I hope this email finds you well. I am reaching out to you today to seek
> assistance with an issue I am facing regarding the installation of 'pip'
> despite my numerous attempts to resolve the problem.
>
> Recently, I performed installation, uninstallation, and even repair
> operations on Python 3.10 on my computer. However, I have noticed that
> 'pip' has never been installed successfully. When I check via the command
> prompt, I receive the following error: "'pip' is not recognized as an
> internal or external command, operable program, or batch file."
>
> I have tried several approaches to resolve this issue. I have verified that
> the PATH environment variable is correctly configured to include the path
> to the Python Scripts directory. I have also attempted to run the
> 'get-pip.py' installation script from the command line, but it did not work
> either.
>
> I am aware that 'pip' is typically installed automatically with Python, but
> I am encountering this persistent difficulty. Therefore, I would like to
> request your assistance and expertise in resolving this 'pip' installation
> issue. I would like to be able to use 'pip' to manage my Python packages
> efficiently.
>
> I am open to any suggestions and steps you can provide to help me resolve
> this problem. Please note that I am a user on the Windows operating system.
>
> Thank you sincerely for your attention and support. I eagerly await your
> guidance to resolve this situation.
>
On Windows, it's recommended to use the Python Launcher and the pip module:

py -m pip install whatever

Mats Wichmann

unread,
Jun 7, 2023, 12:37:51 PM6/7/23
to
On 6/7/23 10:08, MRAB via Python-list wrote:
> On 2023-06-07 15:54, Florian Guilbault via Python-list wrote:
>> Dear Python Technical Team,
>>
>> I hope this email finds you well. I am reaching out to you today to seek
>> assistance with an issue I am facing regarding the installation of 'pip'
>> despite my numerous attempts to resolve the problem.
>>
>> Recently, I performed installation, uninstallation, and even repair
>> operations on Python 3.10 on my computer. However, I have noticed that
>> 'pip' has never been installed successfully. When I check via the command
>> prompt, I receive the following error: "'pip' is not recognized as an
>> internal or external command, operable program, or batch file."
>>
>> I have tried several approaches to resolve this issue. I have verified
>> that
>> the PATH environment variable is correctly configured to include the path
>> to the Python Scripts directory.

I'm assuming you checked - say, with Explorer - that pip.exe really is
where you think it is?
Anyway, if you ask a Windows shell (cmd) to locate it, and it doesn't,
then your PATH is not set up correctly after all.

where pip

should give you back a path that ends witn ...\Scripts\pip.exe

That said, the suggestions already given are on point. Running pip as a
module (rather than as a standalone command) assures that it's
associated with the Python you want it associated with. In today's
world, a lot of developer systems end up with multiple Python
installations (*), and you don't want to use a pip that is bound to the
wrong one, or the next email will be "I installed foo module but my
Python fails to import it".

(*) You can have different Python versions for compat checking, you can
have project-specific virtualenvs, you can have Pythons that come
bundled with a subsystem like Conda, etc.

Thomas Passin

unread,
Jun 7, 2023, 3:49:28 PM6/7/23
to
On 6/7/2023 10:54 AM, Florian Guilbault via Python-list wrote:
> Dear Python Technical Team,
>
> I hope this email finds you well. I am reaching out to you today to seek
> assistance with an issue I am facing regarding the installation of 'pip'
> despite my numerous attempts to resolve the problem.
>
> Recently, I performed installation, uninstallation, and even repair
> operations on Python 3.10 on my computer. However, I have noticed that
> 'pip' has never been installed successfully. When I check via the command
> prompt, I receive the following error: "'pip' is not recognized as an
> internal or external command, operable program, or batch file."
>
> I have tried several approaches to resolve this issue. I have verified that
> the PATH environment variable is correctly configured to include the path
> to the Python Scripts directory. I have also attempted to run the
> 'get-pip.py' installation script from the command line, but it did not work
> either.
>
> I am aware that 'pip' is typically installed automatically with Python, but
> I am encountering this persistent difficulty. Therefore, I would like to
> request your assistance and expertise in resolving this 'pip' installation
> issue. I would like to be able to use 'pip' to manage my Python packages
> efficiently.
>
> I am open to any suggestions and steps you can provide to help me resolve
> this problem. Please note that I am a user on the Windows operating system.
>
> Thank you sincerely for your attention and support. I eagerly await your
> guidance to resolve this situation.

You have by now seen several responses, and the one most likely to be
helpful is to run pip with

py -m pip

I would like to suggest some ways you can make it more likely that you
will get useful suggestions in the future. Basically, please fill in
details about your situation.

1. Say what operating system your computer is running. All the
responses so far have assumed that it is some version of Windows. This
may or may not be correct. We can infer it in this case from the
message you reported ("'pip' is not recognized as an internal or
external command, operable program, or batch file."), but you should say
so that we don't need to guess.

2. Since this question is about your python installation, say how you
installed it, since there are several possibilities. For example, you
may have used the installer from python.org, you may have installed it
from the Microsoft store, etc. These different installations are not
always the same.

3. When you wrote that you "verified that the PATH environment variable
is correctly configured to include the path to the Python Scripts
directory", tell us what that PATH actually is, not just that it is
"correct". We don't know if your idea of "correct" matches ours.

4. Say how you tried to run programs that appeared to fail - running
"python" in a console may launch a different version from the one you
expect. On Windows, running "py" will run the most recent one.

BTW, my own python.org installation of Python 3.11 on Windows 10 does
not include a get-pip.exe or a get-pip.py in its Python311\Scripts
directory (not that it was needed).

Eryk Sun

unread,
Jun 7, 2023, 6:28:36 PM6/7/23
to
On 6/7/23, Thomas Passin via Python-list <pytho...@python.org> wrote:
>
> You have by now seen several responses, and the one most likely to be
> helpful is to run pip with
>
> py -m pip

That won't be of any help if pip isn't installed. By default, Python's
installer attempts to install pip by running the ensurepip package,
but sometimes it fails. It can help to try to manually run ensurepip
in the shell. For example:

py -m ensurepip --default-pip --upgrade --verbose

Thomas Passin

unread,
Jun 8, 2023, 12:01:58 AM6/8/23
to
Yes, but why should anyone besides the OP think pip isn't installed? Let
him try py -m pip. If pip isn't installed he will see something like

C:\Users\tom\AppData\Local\Programs\Python\Python311\python.exe: No
module named pip

Then ensurepip should take care of it. Otherwise it's just that he
hasn't tried the one thing that will certainly work as expected if pip
is present.

Eryk Sun

unread,
Jun 8, 2023, 3:00:43 AM6/8/23
to
On 6/7/23, Thomas Passin via Python-list <pytho...@python.org> wrote:
> On 6/7/2023 6:28 PM, Eryk Sun wrote:
>
>> That won't be of any help if pip isn't installed. By default, Python's
>> installer attempts to install pip by running the ensurepip package,
>> but sometimes it fails. It can help to try to manually run ensurepip
>> in the shell. For example:
>>
>> py -m ensurepip --default-pip --upgrade --verbose
>
> Yes, but why should anyone besides the OP think pip isn't installed? Let
> him try py -m pip. If pip isn't installed he will see something like

I didn't mean to imply that the OP shouldn't first try to run `py -m
pip` or `py -3.10 -m pip`.

Dennis Lee Bieber

unread,
Jun 8, 2023, 3:15:03 PM6/8/23
to
On Wed, 7 Jun 2023 10:36:22 -0600, Mats Wichmann <ma...@wichmann.us>
declaimed the following:


>I'm assuming you checked - say, with Explorer - that pip.exe really is
>where you think it is?
>Anyway, if you ask a Windows shell (cmd) to locate it, and it doesn't,
>then your PATH is not set up correctly after all.
>
>where pip
>
>should give you back a path that ends witn ...\Scripts\pip.exe
>

I'm having a suspicion that recent Windows installers are not including
a pip.exe...

-=-=-
C:\Users\Owner>echo %path%
C:\Python310\Scripts\;C:\Python310\;C:\Python310\Tools\Scripts;C:\Program
Files\PuTTY\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program
Files (x86)\Common Files\Acronis\VirtualFile\;C:\Program Files (x86)\Common
Files\Acronis\VirtualFile64\;C:\Program Files (x86)\Common
Files\Acronis\FileProtector\;C:\Program Files (x86)\Common
Files\Acronis\FileProtector64\;C:\Program Files (x86)\Common
Files\Acronis\SnapAPI\;C:\Program Files\ooRexx;C:\Program
Files\rexx.org\Regina;C:\Program Files\Microchip\xc8\v2.41\bin;C:\Program
Files\Microchip\xc8\v2.36\bin;C:\Program
Files\Microchip\xc16\v2.00\bin;C:\Program
Files\Microchip\xc32\v4.21\bin;C:\Program Files\Microsoft VS
Code\bin;C:\Program Files\dotnet\;C:\Program Files\TortoiseHg\;C:\Program
Files\Calibre2\;C:\Program Files\Microsoft SQL
Server\150\Tools\Binn\;C:\Program Files\Microsoft SQL Server\Client
SDK\ODBC\170\Tools\Binn\;C:\Program Files (x86)\IVI
Foundation\VISA\WinNT\Bin\;C:\Users\Owner\AppData\Local\Microsoft\WindowsApps;C:\Program
Files\JetBrains\PyCharm Community Edition
2021.1.2\bin;;C:\Users\Owner\.dotnet\tools

C:\Users\Owner>where pip.*
INFO: Could not find files for the given pattern(s).

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.

Thomas Passin

unread,
Jun 8, 2023, 5:40:54 PM6/8/23
to
It's in the Scripts directory:

C:\Users\tom\AppData\Local\Programs\Python\Python311\Scripts\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%:

C:\Program Files\Python39\Scripts\pip.exe

Whether this directory ends up on the PATH depends on a user option
during installation. That's one among several reasons to invoke pip with
py -m pip.

It always gets installed, though.


Eryk Sun

unread,
Jun 8, 2023, 6:23:42 PM6/8/23
to
On 6/8/23, Thomas Passin via Python-list <pytho...@python.org> wrote:
>
> It always gets installed, though.

By default, the option to install pip is enabled. It's implemented by
executing ensurepip after the interpreter is installed. However,
ensurepip may silently fail during installation. As a CPython triager
I've come across this problem a couple of times, but it should be
rare. It can possibly be resolved by manually executing ensurepip via
the following command:

py [-3[.X]] -m ensurepip --default-pip --upgrade --verbose

If Python is installed for all users, the latter should be executed
from a shell that has administrator access. Even if this command also
fails, the verbose output in the console may be helpful to further
diagnose the problem.

Thomas Passin

unread,
Jun 8, 2023, 6:52:32 PM6/8/23
to
On 6/8/2023 6:23 PM, Eryk Sun wrote:
Hah! I *knew* someone would come up with an exceptional case. It would
be pretty hard for an ordinary user to know about this encantation or
make progress if something does go wrong. Lucky for me I've always had
the python.org installer work smoothly.

"By default, the option to install pip is enabled" - Why would someone
opt not to install pip, though? Would that be an attempt to prevent
users from installing packages on their own?


Gisle Vanem

unread,
Jun 9, 2023, 4:45:06 AM6/9/23
to
Dennis Lee Bieber wrote:

> 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.*"

Tried it. Oh man what a slow process:
sync & timer &
pwsh -Command Get-ChildItem -Path F:\gv\Python310\ -Recurse -Name -Filter "pip.*" &
timer

(15 results stripped). Completed in 12.44 sec!

As opposed to my own Envtool:
sync & timer &
envtool.exe --evry pip.* | grep "Python310" &
timer

(15 results stripped) Completed in 0.57 sec!

But I have 5 GByte of stuff under 'f:\gv\Python310\'

Envtool is at https://github.com/gvanem/Envtool
Works best together with the amazing EveryThing search engine
by David Carpenter at https://www.voidtools.com

--
--gv

Dennis Lee Bieber

unread,
Jun 9, 2023, 1:44:07 PM6/9/23
to
On Thu, 8 Jun 2023 17:22:22 -0400, Thomas Passin <li...@tompassin.net>
declaimed the following:
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>

Thomas Passin

unread,
Jun 10, 2023, 9:29:50 AM6/10/23
to
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 <li...@tompassin.net>
> 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.
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\pipes

A 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.

risky sibam

unread,
Jun 10, 2023, 9:45:10 AM6/10/23
to
https://www.rosanow.org/
https://www.rosanow.org/page.php?url=about
https://www.rosanow.org/page.php?url=organization-profile
https://www.rosanow.org/page.php?url=where-we-work
https://www.rosanow.org/page.php?url=program-report
https://www.rosanow.org/page.php?url=finance-report
https://www.rosanow.org/page.php?url=human-resource-policy
https://www.rosanow.org/page.php?url=finance-policy
https://www.rosanow.org/page.php?url=communication-policy
https://www.rosanow.org/page.php?url=diversity-inclusion-policy
https://www.rosanow.org/page.php?url=safe-guarding-policy
https://www.rosanow.org/page.php?url=whistle-blowing-policy
https://www.rosanow.org/page.php?url=risk-management-policy
https://www.rosanow.org/page.php?url=anti-fraud-policy
https://www.rosanow.org/page.php?url=inclusion-policy
https://www.rosanow.org/page.php?url=ethical-code-conflict-of-interest-policy
https://www.rosanow.org/page.php?url=child-protection-policy
https://www.rosanow.org/memberlist.php?membertypeID=1
https://www.rosanow.org/memberlist.php?membertypeID=2
https://www.rosanow.org/memberlist.php?membertypeID=3
https://www.rosanow.org/achievementList.php?parentid=1
https://www.rosanow.org/achievementList.php?parentid=2
https://www.rosanow.org/achievementList.php?parentid=3
https://www.rosanow.org/productlist.php?parentid=3
https://www.rosanow.org/productlist.php?parentid=6
https://www.rosanow.org/productlist.php?parentid=4
https://www.rosanow.org/productlist.php?parentid=5
http://rosanow.org/contact.php
http://rosanow.org/photo_gallery.php
http://rosanow.org/video_gallery.php

Eryk Sun

unread,
Jun 10, 2023, 12:33:20 PM6/10/23
to
On 6/10/23, Thomas Passin via Python-list <pytho...@python.org> wrote:
>
> 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"

CMD's `dir` and `for` commands support simple wildcard matching. For
example, the following recursively searches for a file named
"pip*.exe" under "%ProgramFiles%\Python311":

C:\>dir /b /s "%ProgramFiles%\Python311\pip*.exe"
C:\Program Files\Python311\Scripts\pip.exe
C:\Program Files\Python311\Scripts\pip3.11.exe
C:\Program Files\Python311\Scripts\pip3.exe

C:\>for /r "%ProgramFiles%\Python311" %f in (pip*.exe) do @(echo %f)
C:\Program Files\Python311\Scripts\pip.exe
C:\Program Files\Python311\Scripts\pip3.11.exe
C:\Program Files\Python311\Scripts\pip3.exe

The following recursively searches for a directory named "pip" under
"%ProgramFiles%\Python311:

C:\>dir /ad /b /s "%ProgramFiles%\Python311\pip"
C:\Program Files\Python311\Lib\site-packages\pip

Or search for a directory name that starts with "pip":

C:\>dir /ad /b /s "%ProgramFiles%\Python311\pip*"
C:\Program Files\Python311\Lib\site-packages\pip
C:\Program Files\Python311\Lib\site-packages\pip-22.3.1.dist-info
C:\Program Files\Python311\Lib\site-packages\win32\Demos\pipes

With a recursive `for /r path [/d]` loop, the strings in the set have
to include wildcard characters to actually check for an existing file
or directory, else each string in the set simply gets appended to the
directory names in the recursive walk. For example, the following
recursively searches for a directory (i.e. /d) named "pip*" under
"%ProgramFiles%\Python311":

C:\>for /r "%ProgramFiles%\Python311" /d %d in (pip*) do @(echo %d)
C:\Program Files\Python311\Lib\site-packages\pip
C:\Program Files\Python311\Lib\site-packages\pip-22.3.1.dist-info
C:\Program Files\Python311\Lib\site-packages\win32\Demos\pipes

To match a specific name, you can filter the matches using an `if`
statement to compare the base filename of the loop variable (i.e.
[n]ame + e[x]tension) with the required name. For example:

C:\>for /r "%ProgramFiles%\Python311" /d %d in (pip*) do @(
More? if "%~nxd"=="pip" echo %d)
C:\Program Files\Python311\Lib\site-packages\pip

risky sibam

unread,
Jun 10, 2023, 12:56:16 PM6/10/23
to
Pada Rabu, 07 Juni 2023 pukul 22.37.14 UTC+7, Florian Guilbault menulis:
slot gacor online gambling asia teratas no1
<div style="display:none">
<a href="https://sirekan.unsyiah.ac.id/template/slot-gacor/">slot gacor 2023</a>
<a href="https://sidekat.poltekpel-sby.ac.id/uploads/slot-gacor-maxwin/">slot gacor maxwin</a>
<a href="https://absen-daring.unsyiah.ac.id/uploads/slot-server-thailand/">slot server thailand</a>
<a href="https://sirekanptnbh.usk.ac.id/uploads/slot-thailand-gacor/">slot thailand gacor</a>
<a href="https://budimulia.ac.id/mpo-play/">mpoplay</a>
<a href="https://www.kstu.kz/meteorqq/">meteorqq</a>
<a href="https://sirekanptnbh.usk.ac.id/uploads/pola-slot/">polaslot</a>
<a href="https://jte.polinema.ac.id/wp-includes/assets/slot-gacor/">slot gacor</a>
<a href="https://airfest.bem.unair.ac.id/images/upload/slot-gacor-hari-ini/">slot gacor hari ini</a>
<a href="https://airfest.bem.unair.ac.id/images/slot-server-thailand/">slot thailand</a>
<a href="https://inspektorat.bungokab.go.id/slot-gacor/">situs slot gacor</a>
</div>

Thomas Passin

unread,
Jun 10, 2023, 2:40:58 PM6/10/23
to
Yes; I didn't want to get too esoteric with commands that are hard to
figure out and remember, because then why not use Powershell, whose
commands are hard to figure out and remember?

Eryk Sun

unread,
Jun 10, 2023, 3:20:25 PM6/10/23
to
Using `dir /s [/ad] [/b] "[path\]pattern"` with a wildcard pattern is
a simple way to recursively search for a filename or directory,
without needing to pipe the output to a findstr/grep/awk command. It's
also fast. Of course, CMD's wildcards aren't nearly as powerful as
regular expressions.

The examples I included with `for` loops in CMD were for completeness
to show how to get the results in a loop variable for further
processing in a batch script. Personally, I use `for` loops a lot even
when working at the command prompt, but I'm a dinosaur in that regard.
Using PowerShell really should be preferred nowadays.

Thomas Passin

unread,
Jun 10, 2023, 3:46:34 PM6/10/23
to
On 6/10/2023 3:20 PM, Eryk Sun wrote:
> On 6/10/23, Thomas Passin via Python-list <pytho...@python.org> wrote:
>>
>> Yes; I didn't want to get too esoteric with commands that are hard to
>> figure out and remember, because then why not use Powershell, whose
>> commands are hard to figure out and remember?
>
> Using `dir /s [/ad] [/b] "[path\]pattern"` with a wildcard pattern is
> a simple way to recursively search for a filename or directory,
> without needing to pipe the output to a findstr/grep/awk command. It's
> also fast. Of course, CMD's wildcards aren't nearly as powerful as
> regular expressions.

I used find to reduce the number of unwanted hits, which was helpful and
easy to understand even if not very powerful.

> The examples I included with `for` loops in CMD were for completeness
> to show how to get the results in a loop variable for further
> processing in a batch script. Personally, I use `for` loops a lot even
> when working at the command prompt, but I'm a dinosaur in that regard.
> Using PowerShell really should be preferred nowadays.

If one is doing them every day, and especially if it's for a script that
will be reused, those loops expressions are valuable. For a one-shot
use, and for the majority of users who (I'm sure) don't use them very
often, they can be pretty obscure.

PowerShell has some kind of repulsive field effect on me. Plus it has an
ugly console appearance and seems slow. So I avoid it unless I find
some particular case I really need it for, which is hardly ever.

Dennis Lee Bieber

unread,
Jun 10, 2023, 4:22:14 PM6/10/23
to
On Sat, 10 Jun 2023 11:32:53 -0500, Eryk Sun <ery...@gmail.com> declaimed
the following:

>On 6/10/23, Thomas Passin via Python-list <pytho...@python.org> wrote:
>>
>> 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"
>
>CMD's `dir` and `for` commands support simple wildcard matching. For
>example, the following recursively searches for a file named
>"pip*.exe" under "%ProgramFiles%\Python311":
>

So far we've had examples of Python installed for current user, and
Python installed for all users /in Program Files/.

My install is for all users, but is in a top-level directory of its own
(Program Files causes problems when using pip and not remembering to open
an Admin shell).

> C:\>dir /b /s "%ProgramFiles%\Python311\pip*.exe"

So... Here are the results on my machine searching ALL of C:\

C:\Users\Owner>dir /b /s c:\pip*.exe
c:\Apps\ADW Software Modula-2\ASCII\pipedexec.exe
c:\Apps\ADW Software Modula-2\Unicode\pipedexec.exe
c:\GNAT\2019\share\gdb-8.3\python-2.7.16\Scripts\pip.exe
c:\GNAT\2019\share\gdb-8.3\python-2.7.16\Scripts\pip2.7.exe
c:\GNAT\2019\share\gdb-8.3\python-2.7.16\Scripts\pip2.exe
c:\Program Files (x86)\Common Files\Microsoft Shared\ink\pipanel.exe
c:\ProgramData\{F87E77CE-BAA2-49E1-AAE3-1F6B2704ABAA}\OFFLINE\8AFA5EE\A9DCCED0\Pipe.exe
c:\Users\All
Users\{F87E77CE-BAA2-49E1-AAE3-1F6B2704ABAA}\OFFLINE\8AFA5EE\A9DCCED0\Pipe.exe
c:\Users\Owner\AppData\Local\python\mu\mu_venv-38-20230331-155858\Scripts\pip-3.8.exe
c:\Users\Owner\AppData\Local\python\mu\mu_venv-38-20230331-155858\Scripts\pip.exe
c:\Users\Owner\AppData\Local\python\mu\mu_venv-38-20230331-155858\Scripts\pip3.8.exe
c:\Users\Owner\AppData\Local\python\mu\mu_venv-38-20230331-155858\Scripts\pip3.exe
c:\Users\Public\Programs\mblock\resources\app\mlink-v2\exec\python-env\win\Scripts\pip.exe
c:\Users\Public\Programs\mblock\resources\app\mlink-v2\exec\python-env\win\Scripts\pip3.6.exe
c:\Users\Public\Programs\mblock\resources\app\mlink-v2\exec\python-env\win\Scripts\pip3.exe
c:\Windows\WinSxS\wow64_microsoft-windows-t..acyinkingcomponents_31bf3856ad364e35_10.0.19041.1_none_023783a15d5391a7\pipanel.exe

C:\Users\Owner>

GNAT was the last AdaCore/Libre build that included the GPS IDE (I
believe AdaCore still does periodic source code releases of GPS to Linux,
putting the effort to get it working on the Linux distributions -- but that
doesn't help for Windows). Mu is an overly simplistic Python editor pushed
by AdaFruit as it is CircuitPython board-aware. MBlock is a graphical
(drag&drop code templates, fill in any parameters) which I have for an
Arduino-powered robot vehicle.

NO pip*.exe anywhere for Python 3.10 -- and as I stated earlier in the
thread, I even ran the Python Org installer python-3.10.11-amd64.exe in
/repair/ mode; though if that just spawns off ensurepip the result does not
repair anything, as ensurepip finds the library module valid. (Maybe I
should rename the module to junk, and try again? *)

C:\Users\Owner>dir c:\p*
Volume in drive C is Sys_OS
Volume Serial Number is B650-6F92

Directory of c:\

12/07/2019 05:14 AM <DIR> PerfLogs
05/16/2023 04:37 PM <DIR> Program Files
05/16/2023 04:37 PM <DIR> Program Files (x86)
04/26/2023 03:16 PM <DIR> ProgramData
01/01/2017 04:28 PM <DIR> PSFONTS
02/11/2020 02:50 PM <DIR> PSFONTS_Converted
06/08/2023 03:01 PM <DIR> Python310
0 File(s) 0 bytes
7 Dir(s) 1,881,417,326,592 bytes free



*****************************
* What a pain... Just renaming Lib\site-packages\pip =>
Lib\site-packages\pip-junk (and similar for the dist-info file) still had
ensurepip locating it. I had to /delete/ those files completely before
ensurepip would do any processing.

C:\Users\Owner>python -m ensurepip
Looking in links: c:\Users\Owner\AppData\Local\Temp\tmpfof5ikfr
Requirement already satisfied: setuptools in c:\python310\lib\site-packages
(67.6.1)
Requirement already satisfied: pip in c:\python310\lib\site-packages (junk)

C:\Users\Owner>python -m ensurepip
Looking in links: c:\Users\Owner\AppData\Local\Temp\tmpwtielpq_
Requirement already satisfied: setuptools in c:\python310\lib\site-packages
(67.6.1)
Processing
c:\users\owner\appdata\local\temp\tmpwtielpq_\pip-23.0.1-py3-none-any.whl
Installing collected packages: pip
Successfully installed pip-23.0.1

That finally installed

C:\Users\Owner>where pip*
C:\Python310\Scripts\pip3.10.exe
C:\Python310\Scripts\pip3.exe

(NO pip.exe, however).
0 new messages