Reinstalling requirement file using pip

2020-03-02 04:21发布

I try to reinstall requirements for my project using pip but I get this error. There is a previous failed installation. how can I delete it and proceed ?

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

标签: django pip
4条回答
Root(大扎)
2楼-- · 2020-03-02 04:45

You need to delete the whole directory:

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

Now you can reinstall Django again

查看更多
做自己的国王
3楼-- · 2020-03-02 04:46

You can just go ahead and delete that directory, that's what the message is telling you.

查看更多
孤傲高冷的网名
4楼-- · 2020-03-02 04:57

Can you try pip install -I django==1.5.4?

查看更多
够拽才男人
5楼-- · 2020-03-02 05:04

Use:

pip uninstall Django==1.5.4

or

pip uninstall -r requirements.txt

If that still doesn't work, then go into you Python/Lib/site-packages directory where these packages live, and delete them. Then re-run

 `pip install -r requirements.txt` 

and that should work.

查看更多
登录 后发表回答