snippetpythonCriticalCanonical
How to update/upgrade a package using pip?
Viewed 0 times
howupgradepackagepipupdateusing
Problem
What is the way to update a package using pip? These commands do not work:
I know this is a simple question but it is needed as it is not so easy to find (pip documentation doesn't pop up and other questions from stack overflow are relevant but are not exactly about that)
pip update
pip upgradeI know this is a simple question but it is needed as it is not so easy to find (pip documentation doesn't pop up and other questions from stack overflow are relevant but are not exactly about that)
Solution
This is the way
or in short
Using
If you do not have a root password (if you are not the admin) you should probably work with virtualenv.
You can also use the user flag to install it on this user only.
pip install --upgradeor in short
pip install -UUsing
sudo will ask to enter your root password to confirm the action, but although common, is considered unsafe.If you do not have a root password (if you are not the admin) you should probably work with virtualenv.
You can also use the user flag to install it on this user only.
pip install --upgrade --userCode Snippets
pip install <package_name> --upgradepip install <package_name> -Upip install <package_name> --upgrade --userContext
Stack Overflow Q#47071256, score: 1395
Revisions (0)
No revisions yet.