8

I tried to install pip and I got this error:

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.

What does it mean? How to fix it?

Urb
  • 115
  • 6
the doctor
  • 81
  • 1
  • 1
  • 2

3 Answers3

10

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.

Konrad Rudolph
  • 530,221
  • 131
  • 937
  • 1,214
  • 1
    I have Python and pip in my path from a fresh installation of Python 3.8 and I got this warning when installing my first package with pip. A restart of Powershell seemed to fix it. – Moustache Feb 07 '21 at 18:25
0

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

Mr Noob
  • 116
  • 2
  • 10
0

In my case, it was actually easier than I thought.

This is the solution if you're on Windows:

  • Go to your PC
  • Right click -> properties
  • Go to the advanced system settings
  • Go to advanced
  • Then go to Environment variables
  • Once you're there go to system variables and select the one that says 'PATH' and click on edit
  • Click on New and then copy your script path, it generally is in this route C:\Users\pc\AppData\Local\Programs\Python\Python311\Scripts
  • Voila, if it doesn't work uninstall your libraries and install them again with: pip uninstall [name of the library]