Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

pip install with wipe option by default

Tags:

python

pip

In a python (django) project, when I change the location of an existing dependency with pip, and I reinstall the updated requirements.txt file in another machine, I am being prompted with a message like this:-

Obtaining South from git+git://github.com/lambdafu/django-south.git@7bb081348d854d0b1aa82b87da5b446ad5d6f2a6#egg=South-dev (from -r requirements.txt (line 5))
  git clone in ./src/south exists with URL git://github.com/clones/django-south.git
  The plan is to install the git repository git://github.com/lambdafu/django-south.git
What to do?  (s)witch, (i)gnore, (w)ipe, (b)ackup 

At this point, I will select "w" (wipe) to wipe out the old copy of django-south and use django-south from the new repository location.

I would like to do this as a default behavior without needing to type "w".

Is there an option I can specify when giving my

pip install -r requirements.txt

command so that the installation process will automatically know that I want to wipe out the older copy and will not prompt me to choose s/i/w/b ?

like image 303
Calvin Cheng Avatar asked Feb 18 '12 07:02

Calvin Cheng


1 Answers

From PIP version 1.1 onwards you can also use:

--exists-action=EXISTS_ACTION Default action when a path already exists.Use this option more then one time to specify another action if a certain option is not available, choices: (s)witch, (i)gnore, (w)ipe, (b)ackup

like image 182
qubird Avatar answered Oct 02 '22 17:10

qubird