'pip' is not recognized as an internal or external command in python

Question:

I’m running into a weird error when trying to install pip
This is the sequence that I typed into my command line:
pip install opencv-python
What could be causing this?

This is what I get when I type in echo %PATH%:

C:Program Files (x86)Common FilesIntelShared Librariesredistintel64compiler;C:Windowssystem32;C:Windows;C:WindowsSystem32Wbem;C:WindowsSystem32WindowsPowerShellv1.0;C:WindowsSystem32OpenSSH;C:Program FilesMicrosoft SQL ServerClient SDKODBC170ToolsBinn;C:Program Files (x86)Microsoft SQL Server150ToolsBinn;C:Program FilesMicrosoft SQL Server150ToolsBinn;C:Program FilesMicrosoft SQL Server150DTSBinn;C:Program Files (x86)Microsoft SQL Server150DTSBinn;C:Program FilesJavajdk1.7.0_80bin;C:WINDOWSsystem32;C:WINDOWS;C:WINDOWSSystem32Wbem;C:WINDOWSSystem32WindowsPowerShellv1.0;C:WINDOWSSystem32OpenSSH;C:Program Filesdotnet;C:Program Files (x86)IntelIntel(R) Management Engine ComponentsDAL;C:Program FilesIntelIntel(R) Management Engine ComponentsDAL;E:MATLABR2022bbin;D:nodejs;:users“naglaa“AppDataProgramsPythonPython310;C:Program Files (x86)Common FilesIntelShared Librariesredistintel64compiler;C:Windowssystem32;C:Windows;C:WindowsSystem32Wbem;C:WindowsSystem32WindowsPowerShellv1.0;C:WindowsSystem32OpenSSH;C:Program FilesMicrosoft SQL ServerClient SDKODBC170ToolsBinn;C:Program Files (x86)Microsoft SQL Server150ToolsBinn;C:Program FilesMicrosoft SQL Server150ToolsBinn;C:Program FilesMicrosoft SQL Server150DTSBinn;C:Program Files (x86)Microsoft SQL Server150DTSBinn;C:Program FilesJavajdk1.7.0_80bin;C:WINDOWSsystem32;C:WINDOWS;C:WINDOWSSystem32Wbem;C:WINDOWSSystem32WindowsPowerShellv1.0;C:WINDOWSSystem32OpenSSH;C:Program Filesdotnet;C:Program Files (x86)IntelIntel(R) Management Engine ComponentsDAL;C:Program FilesIntelIntel(R) Management Engine ComponentsDAL;E:MATLABR2022bbin;D:nodejs;:users“naglaa“AppDataProgramsPythonPython310;C:UsersnaglaaAppDataLocalMicrosoftWindowsApps;;C:Program FilesAzure Data Studiobin;C:Usersnaglaa

Asked By: Naglaa M Morsy

||

Answers:

“naglaa“ in your path looks suspicious. User names shouldn’t be in quotes, and especially smart quotes. The drive letter is missing as well: :users“naglaa“AppDataProgramsPythonPython310.

Ideally, don’t put Python in the Windows path and use py (the Python Launcher) as in py -m pip install opencv-python. If you have multiple Pythons installed you can say py -0 to list installed Pythons and py -3.10 -m pip install opencv-python to install on a specific version.

See Python Launcher for Windows.

Answered By: Mark Tolonen

I don’t think pip has been added into your PATH.
Usually pip.exe is located in your "…PythonPython310Scripts". (You do have python added in the PATH tho since you have "…PythonPython310" in the list).

So all you have to do is to add the existing "Scripts" folder into PATH variable and you will be good to go.

Answered By: Gr4yMana7ee
Categories: questions Tags:
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.