9

I just installed Python 2.7.10 on windows 10.
I have added my python and pip directory to my PATH like so:

enter image description here

My Scripts folder looks like this:

enter image description here

My problem is, when I type in "pip" in command prompt and press enter absolutely nothing happens, even if I wait several minutes. If I remove the Scripts directory from the PATH variable I just get the error message like "pip not recognized as internal or external command". Python works fine. I have also tried to reinstall both pip and Python but the same problem occurs. So, does anyone have any idea about why pip does not do anything?

**Edit: ** when I say it does not do anything, I mean the cmd "hangs", like if it is waiting for something to happen. The cursor just keeps on blinking.

PandaDeTapas
  • 516
  • 1
  • 7
  • 16

5 Answers5

14

One command that is bound to work is writing:

python -m pip install requests

This works because you hand off the script invocation to python, which you know works, instead of relying on the PATH environment variable of windows, which can be dodgy.

Packages like numpy that require c-extensions to be built, will not work with pip unless you have a C Compiler installed on your system. More information can be found in this question.

If you are, as you're saying, unfamiliar with the python environment, then let me assure you, you will have a better day by installing Anaconda.

Anaconda is a completely free Python distribution (including for commercial use and redistribution). It includes more than 300 of the most popular Python packages for science, math, engineering, and data analysis.

Anaconda comes with numpy, of course.

Community
  • 1
  • 1
Sebastian Wozny
  • 16,943
  • 7
  • 52
  • 69
  • Ok I see. However, I managed to install numpy by downloading from the unnoficial binaries site, but I will install Anaconda anyways! Tanks! – PandaDeTapas Nov 25 '15 at 14:41
  • Anaconda also comes with matplotlib, scipy, pandas, ipython and spyder. I think working with anaconda on windows is easier than working with python on linux. – Sebastian Wozny Nov 25 '15 at 14:43
  • Thanks! I have been trying to solve this for hours and this worked! – JKnecht Jan 15 '16 at 18:59
  • Try `pip-3.5` or `pip-2.7`. This is what worked for me on Amazon EC2-Instance e.g., `pip-3.5 install ldap3`. – Kyle Bridenstine Jun 01 '18 at 17:43
4

After Python including pip at package, pip commands not work sometimes. Then you can use pip through python like

python -m pip <pip commands that you want>
IngYu Jo
  • 69
  • 5
2

Try disabling your virus scanner. If this fixes it, exclude the C:\Python27\ folder from scanning (at your own risk).


I had this same issue: typing pip on the command line just puts the cursor on the next line, and nothing happens. I was sure my PATH system variable had C:\Python27\ and C:\Python27\Scripts\ in it, and I could verify it using echo %PATH% on the command line.

I found that I had to disable my virus scanner (Avast). I excluded the C:\Python27\ from virus scanning, and now everything works. Apparently the scanner is interfering with Python's ability to load the module.

Daniel A.A. Pelsmaeker
  • 47,471
  • 20
  • 111
  • 157
  • I waited about five minutes with a blinking cursor, then the script finally started executing in a new window while Avast popped up a "this script may be dangerous, we're doing a 15-second scan" window. – Noumenon Mar 14 '17 at 22:53
0

Add the following path or you can also cd to the path and then try pip command, it will work fine.

C:\Python27\Lib\site-packages\pip

int-main
  • 57
  • 1
  • 12
0

I had the same issue after uninstalling my antivirus, which was blocking the script. The issue was resolved.