If pip is not installed or the path is not set correctly you will get an error like below while invoking it in windows command prompt.
pip install sklearn'pip' is not recognized as an internal or external command,operable program or batch file.Here are the steps to get pip in your windows box.
- Download
get-pip.py
. Copy and paste the contents of the link in a notepad and save it as get-pip.py, remember not in .txt format but .py format. - Next install it.
python get-pip.py
- Find the recently installed pip.exe in your machine. It’s generally in C:\Python27\Scripts or similar folder depending on the python version you installed. You can set the path variable in windows using these instructions.
– Click on the tab “Advanced”. In it click on Environment Variables.
– In the new window click on System Variables. Select “Path” and click on “Edit”.
– Click on new and enter C:\Python27\Scripts\ in the space.
– Finally click ok to all windows and re-open command prompt.
- If you have followed the instructions correctly you will now be able to install packages using pip.
pip install sklearnThat’s all you need to install pip in windows.
Tip:- Some people make mistake of executing pip from Python interpreter and get the below error.
>>> pip install sklearn
File "<stdin>", line 1
pip install sklearn^SyntaxError: invalid syntax
>>>
But, from the above tutorial you now know that pip is installed and executed from command prompt and not from the interpreter.
Hope you find this simple tutorial useful. Let us know in comment section if you face any issue.
LOVE THAT. THANKS
ReplyDelete