WARNING: The scripts pip.exe, pip3.8.exe and pip3.exe are installed in '...' which is not on PATH

Viewed 27111

I tried to install pip and I got this error:

[33m  WARNING: The scripts pip.exe, pip3.8.exe and pip3.exe are installed in 'C:\Users\Itamar\AppData\Local\Programs\Python\Python38\Scripts' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.[0m 

What does it mean? How to fix it?

thanks in advance

2 Answers

It means that you’ve installed the Python binaries, but they won’t be found when you just type python into the terminal.

You will either need to type the entire path, or add the installation directory to your system’s PATH variable, as described in another Stack Overflow discussion.

(this worked for my case, given that i have only one user name/profile in my PC AND have only one Python version i.e Python310).

it will search for last two folders with name Python(any version) and Scripts.

the solution is using Batch, after searching many SO questions but only got to save some of the references :
Use multiple wildcards in a path in batch file
https://stackoverflow.com/a/53779705/9222942
SETX doesn't append path to system path variable
https://stackoverflow.com/a/17247259/9222942

  1. Save below code to batch file with name i.e setpath.bat
@echo off <br>
setlocal<br>
setlocal enabledelayedexpansion<br>
@echo off<br>
:: search for Scripts folder that resides in : C:\Users\User Name\AppData\Roaming\Python\Python*\Scripts<br><br><br>
for /d /r "%USERPROFILE%" %%j in (Python) do (<br>
    for /D %%i in ("%%j\Python*") do (<br>
      for /D %%d in ("%%i\Scripts") do (<br>
                @if exist "%%d" (<br>
                    @set _variable=%%d<br>
                    @echo !_variable!<br>
                    ::SET Path here<br>
                    setx path %%d<br>
                )<br>
      )<br>
    )<br>
)<br>
<br><br><br>
endlocal<br>
pause<br>
  1. Double click on the setpath.bat file.

  2. the path should then be added to your user path with SUCCESS: Specified value was saved.

Related