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 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 is designed to upgrade python packages and not to upgrade python itself. pip shouldn't try to upgrade python when you ask it to do so. Don't type pip install python but use an installer instead.
Python pip comes pre-installed on 3.4 or older versions of Python. To check whether pip is installed or not type the below command in the terminal. This command will tell the version of the pip if pip is already installed in the system.
By default, pip installs the latest version, but here you pin it to a specific one.
The way is
pip install <package_name> --upgrade
or in short
pip install <package_name> -U
Using 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 <package_name> --upgrade --user
For a non-specific package and a more general solution, you can check out pip-review. A tool that checks what packages could/should be updated.
To install:
$ pip install pip-review
Then run:
$ pip-review --interactive requests==0.14.0 is available (you have 0.13.2) Upgrade now? [Y]es, [N]o, [A]ll, [Q]uit y
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With