'pip' is not recognized as an internal or external command, HAS WORKED BEFORE

i’ve had pip on my windows 11 system for a while, but after using it today it suddenly stopped working. it is installed but is not recognized by other programs and can’t be used by command prompt.


this is the image, it displays this:

C:\Users\nymhole>setx PATH "%PATH%;C:\Python34\Scripts"

WARNING: The data being saved is truncated to 1024 characters.

SUCCESS: Specified value was saved.

C:\Users\nymhole>python -m pip install pip
Requirement already satisfied: pip in c:\users\nymhole\appdata\local\programs\python\python312\lib\site-packages (24.2)

C:\Users\nymhole>pip help install
'pip' is not recognized as an internal or external command,
operable program or batch file.

i am disgustingly inexperienced so any help would be great, thanks.

i also tried this after posting this

C:\Users\nymhole>pip help install
'pip' is not recognized as an internal or external command,
operable program or batch file.

C:\Users\nymhole>setx PATH "%PATH%;C:\users\nymhole\appdata\local\programs\python\python312\lib\"

WARNING: The data being saved is truncated to 1024 characters.

SUCCESS: Specified value was saved.

C:\Users\nymhole>pip
'pip' is not recognized as an internal or external command,
operable program or batch file.

please let me know if i should undo this.

Well, the warning being output by the modifications to path seem quite relevant. Did you check that the path to python scripts you added is actually fully there inside of %PATH%?

It looks like your PATH is too long. Windows has some complicated limitations on how long your PATH can be. Evidently your PATH is longer than the 1024 character max that setx can handle. There are some other ways you can manipulate your PATH that have longer limits, but not all software will work right with a long PATH.

Probably the best route forward would be to try manually trimming down the length of your PATH.

Window’s PATH limitations is part of why it’s not recommended to add multiple Python installations to your PATH and to instead use the py launcher.

Here’s a few related resources that may be of some help:

1 Like

using echo %PATH%, i got C:\Users\nymhole\AppData\Local\Programs\Python\Python312\Scripts\;C:\Users\nymhole\AppData\Local\Programs\Python\Python312\;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.6\bin;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.6\libnvvp;C:\Program Files\Smart Projects\IsoBuster;C:\Program Files\Oculus\Support\oculus-runtime;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\dotnet\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\TortoiseGit\bin;C:\ProgramData\chocolatey\bin;C:\Program Files\NVIDIA Corporation\Nsight Compute 2024.3.0\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\Git\cmd;C:\Users\nymhole\AppData\Local\Microsoft\WindowsApps;;C:\Users\nymhole\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\nymhole\.dotnet\tools;C:\Users\nymhole\AppData\Local\Microsoft\WinGet\Packages\Gyan.FFmpeg_Microsoft.Winget.Source_8wekyb3d8bbwe\ffmpeg-7.0.2-full_build\bin;, i think C:\Users\nymhole\AppData\Local\Programs\Python\Python312\Scripts\;C:\Users\nymhole\AppData\Local\Programs\Python\Python312\ is the actual path for pip

im unsure if this is accurate, as the path im trying to set appears to be only 20 characters long, please let me know if i am mistaken.

i am referring to “C:\Python34\Scripts” only being 20 characters long

The limit I mentioned is on the total length of the entire PATH environment variable, not each ;-delimited entry (which have a different limit).

i see. do you think that the path for pip has been trunicated out? using echo %PATH% i see that C:\Users\nymhole\AppData\Local\Programs\Python\Python312\Scripts\;C:\Users\nymhole\AppData\Local\Programs\Python\Python312\; are the first 2 results. is one of these the path for pip? if not, what would that look like? so i can add it once i’ve gotten past the max character limit.

I’m not sure which directory a pip.exe shim would usually be placed in on Windows. Usually I’d recommend running pip through the py launcher as py -m pip instead of using a separate pip on your PATH. That way you can circumvent most PATH shenanigans.

This post from a related might also be helpful.

1 Like

using py -m pip uninstall pip, i found

Uninstalling pip-24.2:
  Would remove:
    c:\users\nymhole\appdata\local\programs\python\python312\lib\site-packages\pip-24.2.dist-info\*
    c:\users\nymhole\appdata\local\programs\python\python312\lib\site-packages\pip\*
    c:\users\nymhole\appdata\local\programs\python\python312\scripts\pip3.12.exe
    c:\users\nymhole\appdata\local\programs\python\python312\scripts\pip3.exe

what im going to do right now is try to reinstall it, but i am putting this here for your future reference in troubleshooting. these are the default install locations on my device.

It looks like there was pip3 in one of the directories that was already on your PATH.

Before uninstalling / after reinstalling, you might want to try using pip3 instead of pip.

1 Like

There are some duplicates in that list of paths.

pip3 is only for python3 right? pip3 does work. reinstalling was just a bad idea that did nothing and could have probably done more damage.

that makes sense, i did try adding paths multiple times to try to troubleshoot it. how would i remove these duplicate paths, and which ones should i remove?

There’s a Control Panel where you can edit the environment variables. Open Windows Settings and search for “environment variables”.

C:\Users\nymhole>setx PATH "%PATH%;C:\Users\nymhole\AppData\Local\Programs\Python\Python312\Lib\site-packages\pip"

WARNING: The data being saved is truncated to 1024 characters.

SUCCESS: Specified value was saved.

C:\Users\nymhole>pip
'pip' is not recognized as an internal or external command,
operable program or batch file.

C:\Users\nymhole>path
PATH=C:\Users\nymhole\AppData\Local\Programs\Python\Python312\Scripts\;C:\Users\nymhole\AppData\Local\Programs\Python\Python312\;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.6\bin;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.6\libnvvp;C:\Program Files\Smart Projects\IsoBuster;C:\Program Files\Oculus\Support\oculus-runtime;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\dotnet\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\TortoiseGit\bin;C:\ProgramData\chocolatey\bin;C:\Program Files\NVIDIA Corporation\Nsight Compute 2024.3.0\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\Git\cmd;C:\Users\nymhole\AppData\Local\Microsoft\WindowsApps;;C:\Users\nymhole\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\nymhole\.dotnet\tools;C:\Users\nymhole\AppData\Local\Microsoft\WinGet\Packages\Gyan.FFmpeg_Microsoft.Winget.Source_8wekyb3d8bbwe\ffmpeg-7.0.2-full_build\bin;

ive just now realized i am trying to add things to the front of the path that already exists, and my command is to set the path as (the path itself)+the new path i am adding.

yes, i see here.


i can also see that “path” has in fact been trunicated to 1024 characters “;c:\Progra” i added the new path pip myself, and there was a second temp, labled as tmp, under the same temp folder. just now realizing that could have been for a specific program that bade that new variable and used that instead of temp but it might make the variable again, otherwise it will just break i guess.

also, my adding of pip here did nothing. i think i have to add it to path.

okay again i did something else.


i can see that i can edit them all individually here and i may be able to add pip here. that is what i am going to do now as well as delete duplicates