简体   繁体   中英

Pip not working on windows 10, freezes command prompt

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.

命令提示符冻结时的图片

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.

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.

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.

@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.

Marco的答案工作得很好,但问题的实际解决方案是你应该使用python -m pip编写你的pip命令而不是pip所以你的命令将是python -m pip install requests

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.

尝试使用易于安装的pip,它以相同的方式工作

好吧,当你运行python -m pip时,它实际上启动了pip.exe作为子进程,所以最后它为我冻结了同样的东西,虽然它运行的时间更长...更糟糕的是pip.exe进程是完全僵尸,即使使用ProcExpl也无法杀死它....

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

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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM