使用pip重新安装需求文件

时间:2014-01-23 22:30:25

标签: django pip

我尝试使用pip重新安装项目的需求,但是我收到此错误。之前的安装失败。如何删除它并继续?

E:\projects\project course\tkz>pip install -r requirements.txt
Downloading/unpacking Django==1.5.4 (from -r requirements.txt (line 1))
pip can't proceed with requirement 'Django==1.5.4 (from -r requirements.txt (lin
e 1))' due to a pre-existing build directory.
location: c:\users\sina\appdata\local\temp\pip_build_sina\Django
This is likely due to a previous installation that failed.
pip is being responsible and not assuming it can delete this.
Please delete it and try again.

Cleaning up...

4 个答案:

答案 0 :(得分:8)

您可以继续删除该目录,这就是消息告诉您的内容。

答案 1 :(得分:4)

使用:

pip uninstall Django==1.5.4

pip uninstall -r requirements.txt

如果仍然无效,请进入这些包所在的Python/Lib/site-packages目录,然后删除它们。然后重新运行

 `pip install -r requirements.txt` 

这应该有用。

答案 2 :(得分:1)

你能试试pip install -I django==1.5.4吗?

答案 3 :(得分:0)

您需要删除整个目录:

cd c:\users\sina\appdata\local\temp\pip_build_sina
rm -R Django

现在您可以重新安装Django