Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

I can't use pip (Windows)

I'm wanting to learn machine learning, but it requires that I use 'pip.' I'm still very new to a lot of this stuff. I've installed Python 3.4 64-bit and get-py.py.

When I run pip install sklearn I get 'pip' is not recognized as an internal or external command, operable program or batch file.

Here's a screenshot of my environmental variable PATH

https://gyazo.com/c7ec926401878845d5c4f9a556cf00ee

Any help would be greatly appreciated. I have checked out other posts where people had similar issues, but I tried various things and nothing worked.

like image 809
Jason Procka Avatar asked May 28 '17 20:05

Jason Procka


People also ask

Why is pip not working on Windows?

A “pip: command not found” error occurs when you fail to properly install the package installer for Python (pip) needed to run Python on your computer. To fix it, you will either need to re-install Python and check the box to add Python to your PATH or install pip on your command line.

Why can't I install using pip?

One of the most common problems with running Python tools like pip is the “not on PATH” error. This means that Python cannot find the tool you're trying to run in your current directory. In most cases, you'll need to navigate to the directory in which the tool is installed before you can run the command to launch it.

Can't use pip install in CMD?

PIP installation is not added to the system variable – In order to be able to run Python commands from a CMD window, you will need to add the path of your PiP installation to your PATH in the system variable. If you installed Python using the installation executable, it should be added automatically.


2 Answers

Easiest solution is to just download a platform like Anaconda for example. It is Python with many libraries (sklearn, pandas, numpy, ...) and also with pip, all in a user-friendly Windows installer package, that takes care of everything for you.

https://www.continuum.io/downloads

If you really want to do it yourself, then

  1. download get-pip.py (https://bootstrap.pypa.io/get-pip.py)

  2. make sure you have Python installed and in your PATH, for example by running python --version in command prompt

  3. Navigate to the directory, where you downloaded get-pip.py (in command prompt using the command cd).

  4. Run the command python get-pip.py from a command prompt with admin privileges (possibly not needed, but just to make sure).

  5. This should be all. Close your command prompt, open it again and run pip --version to test it. If it doesn't work, then search your computer for a file named pip.exe (most likely in your Python directory) and if you find it, add its path to your PATH variable (given the screenshot, I assume you know how to do this).

like image 140
Joe Samanek Avatar answered Oct 22 '22 02:10

Joe Samanek


I downloaded Python 3.6 and the pip was installed on my system. I found pip at below location:

C:\Users\Admin\AppData\Local\Programs\Python\Python36\Scripts

Also, before I found pip I used below command on my command prompt to install pyperclip:

python -m pip install pyperclip
like image 38
AkshayKrish Avatar answered Oct 22 '22 01:10

AkshayKrish