6

I recently installed Python for Windows 10 and need to use pip command to install the requests package. However, whenever I try to use pip in cmd it just freezes my command prompt.

Using CTRL + C, CTRL + D or any command like that to cancel it does not work either, the prompt just freezes like its waiting for input or something, but I get no output or any clue about what to do.

Picture of command promt when its frozen

I have set the PATH variable correctly, and my computer finds pip and launches it, but it just freezes. I have also tried reinstalling Python countless times and manually reinstalling pip but nothing seems to do the trick.

vvvvv
  • 25,404
  • 19
  • 49
  • 81
Olof H
  • 67
  • 2
  • 6
  • Try `python -m pip install requests` or, if the new launcher is installed, `py -2 -m pip install requests`. – Eryk Sun Nov 11 '15 at 00:31
  • BTW, `Ctrl+D` (ASCII end-of-transmission, `EOT`) signals end-of-file (`EOF`) for stdin, but only in a Unix terminal. The Windows console doesn't implement anything exactly like this. The closest analog is the `ReadFile` function, which, when reading from the console, treats `Ctrl+Z` (ASCII substitute, `SUB`) at the beginning of a line as `EOF`. Since `ReadFile` has to read a line of input, you have to key `Ctrl+Z, Enter`, while on Unix `Ctrl+D` is handled in the terminal and doesn't require pressing enter. – Eryk Sun Nov 11 '15 at 01:15
  • I thought I had this problem too; it turns out it was just a _really_ long initialization before the UI updated with downloading. Antivirus might have been the culprit. – kayleeFrye_onDeck Apr 03 '17 at 23:14

10 Answers10

15

I had exactly the same problem here (Windows 10.0.10240). After typing just "pip" and hitting enter, nothing else happened on the console. This problem was affecting including other .exe compiled python related scripts like mezzanine-project.exe.

The antivirus AVAST was the culprit (in my case) !!!

After disabling AVAST files module (or uninstalling AVAST) pip started working again.

Márcio Moreira
  • 477
  • 4
  • 16
  • 1
    can't believe people are advocating disabling AV software when installing packages from a remote host. lolz. – bytejunkie Feb 04 '16 at 12:18
  • AVAST is not the only antivirus in the world (lolz). I just replaced it for another one. – Márcio Moreira Feb 04 '16 at 12:54
  • but wouldnt the right path be to email the vendor and say, hey, your software is doing something weird? – bytejunkie Feb 04 '16 at 13:01
  • Yes, you are right. I got sick of AVAST but it is not just for me, so I just opened a support ticket with them https://pt.support.avast.com/support/tickets/175186 – Márcio Moreira Feb 04 '16 at 13:32
  • think that tickets attached to your login, but will do the same with them. though i think the actual answer lies with @eryksun – bytejunkie Feb 04 '16 at 13:57
4

i didn't think i had the same issue as @Marcio, but the longer it went on, it turned out i did.

In avast, goto the settings, goto Active PRotection, go to File System Shield and add an exclusion for

C:\Python27\Scripts

should work without a reboot, did for me, I was having issues with the Virtualenv.exe which is in that folder.

bytejunkie
  • 1,003
  • 14
  • 30
1

Try to use easy-install insted of pip it works in the same way.

vvvvv
  • 25,404
  • 19
  • 49
  • 81
Marco Del Toro
  • 112
  • 1
  • 7
1

@eryksun provided what I think should be the answer to this question. I also have had the command prompt hang whenever I try to use pip, but I do not want to use easy_install. The solution (from @eryksun) was to use python -m pip install package_name. This works great for managing python packages in windows 10.

jthomas
  • 2,437
  • 1
  • 13
  • 15
1

Marco's answer worked perfectly but the actual solution to the problem is that you should write your pip commands using python -m pip instead of just pip so your command will be python -m pip install requests

omarwaleed
  • 571
  • 7
  • 19
  • If this actually works for you, then its more likely that you've got the folder containing the Python exe on your path, but not the subfolder Scripts. – bytejunkie Mar 15 '16 at 16:32
1

I had this exact problem with the numpy module. The only way I could fix it is by following the steps found here: Installing NumPy and SciPy on 64-bit Windows (with Pip)

The steps were to

  1. Download the appropriate precompiled wheel from http://www.lfd.uci.edu/~gohlke/pythonlibs/
  2. Type pip install /path/to/module.whl

This worked perfectly for me. Hope this helps anyone else with this exact issue.

Community
  • 1
  • 1
Blairg23
  • 11,334
  • 6
  • 72
  • 72
0

Well, when you run python -m pip, it actually starts pip.exe as a child process, so in the end it freezes the same for me, although it runs a bit longer... Worse is that the pip.exe process is completely zombie, no way to kill it even with ProcExpl....

  • Answers should answer the question, this really just verifies the poster isn't the only one seeing the problem and would be more appropriate as a comment. – blm Nov 22 '15 at 20:26
0

I had the same problem. Just disable your antivirus and it should work.

0

Thanks to @Marco Del Toro's answer, using easy_install worked for me: I could install the packages I needed for my project. I also managed to fix pip using easy_install so pip also works for me now. The solution to fixing pip was: easy_install pip.


This answer was posted as an edit to the question Pip not working on windows 10, freezes command promt by the OP Olof H under CC BY-SA 3.0.

vvvvv
  • 25,404
  • 19
  • 49
  • 81
-1

If you have a certain network it can block pip for installation. For my case I used my own network without VPN.

  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Nov 12 '22 at 12:30