Python PIP: is the order in which parameters are specified?

What's the difference between

$ pip install --upgrade -r requirements.txt



$ pip install -r requirements.txt --upgrade




source to share

3 answers

(Looking at the source )

pip uses the standard optparse module, which does not differ from the order of the options, so the same. This is generally accepted if the tool does not trick the order, which is not the case.



doesn't matter, order doesn't matter



The pythonic way to deal with comand string arguments is to use the module that comes with the python standard library.

And after you pass the arguments, the application will receive them and parse them in a specific order (look at the pip source code if that's important to you).

Some actions can be postponed after analysis, but they have a strict order.

The order is not important and both examples will always do the same (unless some error occurs).



All Articles