What is the way to update a package using pip? those do not work
pip update
pip upgrade
I know this is a simple question but as it is not so easy to find (pip documentation doesn't pop up and the questions from stack overflow are relevant but are not exactly about that)
The way is
or in short
sudo
will ask to enter your root password to confirm the action.If you do not have a root password (if you are not the admin) you should probably work with virtualenv and then you should drop the
sudo
:If you only want to upgrade one package, refer to @borgr's answer. I often find it necessary, or at least pleasing, to upgrade all my packages at once. Currently, pip doesn't natively support that action, but with sh scripting it is simple enough. You use
pip list
,awk
(orcut
andtail
), and command substitution. My normal one-liner is:This will ask for the root password. If you do not have access to that, the
--user
option ofpip
or virtualenv may be something to look into.