Pip anamoly when attempting to install pip and a module

Hello,

when I type the following instruction in the command prompt (from: Installation - pip documentation v24.2):

py -m pip install --upgrade pip

The following output is observed (:

Requirement already satisfied:  pip in c:\users\my_pc\appdata\local\programs\python\python312\lib\site-packages (24.2)

However, if I type:

pip install numpy

the following is observed:

'pip' is not recognized as an internal or external command,
operable program or batch file.

Does someone know the discrepancy?

The bin/scripts directory for you Python installation isn’t on your PATH.

I think this isn’t unusual, since by default the installer for windows doesn’t add the interpreter bin directory to your PATH (however there’s a checkbox you can click in the installer if you want this).

Instead of relying on python/pip being on your PATH, it’s recommended to use the py launcher, as you did in the first command.

See also

Thank you for your feedback.

Apparently, if I preface it with: py -m it works fine (in my other pc, this was not the case). Before, I could just type pip install library_name. Now, I have to type py -m pip install library_name.