“pip” is the standard Python package manager. It is used to install, update and remove packages (libraries) that extend the functions of Python.
Why is it useful in Windows CMD?
- It allows you to manage packages easily from the command line.
- It is essential to customize your Python environment with the tools you need for your projects.
If pip doesn’t work for you in cmd, install python.
If you already have Python installed, and it doesn’t work:
Find where you installed Python. I found the installation path at:
C:\Users\Kunal\AppData\Local\Programs\Python\Python312
The latest Python312 folder depends on the version you have.
Inside you will find the Scripts folder and inside the pip.exe executable which we want to run when we call it through CMD. Copy the path of the Scripts folder.
Activate PIP in Windows CMD.
Press Win + X, click Run/Execute, type sysdm.cpl, and click OK/Accept.
On this screen, choose the Environment Variables option:
Here we establish the various variable routes that the system allows access through CMD. We click edit.
You have to enter the Python Scripts path here. My was in:
C:\Users\Kunal\AppData\Local\Programs\Python\Python312
C:\Users\Kunal\AppData\Local is the same as %LOCALAPPDATA%
Now we have to verify that our changes have actually been made or not. To do this, we open CMD and run pip.
If everything has gone correctly, you will see the different operations that you can perform using pip.