According to The Ubuntu lifecycle and release cadence Ubuntu 16.04 has full support until mid-2021.

Yet when I run:

pip install cryptography

it says:

Requirement already satisfied: cryptography in /usr/lib/python2.7/dist-packages (1.2.3)

cryptography 1.2.3 is from March, 2016.

The cryptography package fully supports Python 2.7, and there were dozens of new cryptography versions released since 2016, so why is it impossible to update it?


From results of man pip :

-U, --upgrade
         Upgrade all packages to the newest available version. 

The -U option of pip upgrades all package(s) that come after it in the same command to the newest available version. An exception is made where upgrading a package will conflict with a newer version of one of that package's installed dependencies, in which case the dependency package is kept at the newer version and an older version of the same dependency package is installed alongside it to allow both packages to be upgraded to the newest available version.

Open the terminal and type:

sudo pip install -U cryptography   

This command will upgrade the cryptography package from 1.2.3 to the latest version, 2.4.2.

Check the version of the upgraded cryptography Python module.

$ pip freeze | grep cryptography
  • Can you explain why the -U flag is important here? – Luis Jan 17 at 12:34

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.