Including the Pyca cryptography library

This page describes how to update the gcloud command-line tool with the Pyca cryptography library.

The Pyca cryptography library is a dependency for the gcloud tool. Because it includes cryptographic routines, this library is not distributed with the Cloud SDK.

You need to use version v2.2 or later of the Pyca cryptography library.

Install cryptography

Installing with pip

If your system has pip, the command-line interface to the Python Package Index, run the following command.

pip install --user cryptography

Depending on your system configuration, you may need to run this command as the root user:

sudo pip install cryptography

Installing with apt-get

If your system is based on Debian, run the following command.

sudo apt-get install python-cryptography

Installing with yum

If your system is based on Redhat or CentOS, run the following command.

sudo yum install python2-cryptography

Installing on Windows

You need pip installed. Then, run the following command.

pip install cryptography

Enable site packages

Once the cryptography library is installed, you also need to enable site packages by setting the CLOUDSDK_PYTHON_SITEPACKAGES environment variable to 1. This environment variable setting tells the Cloud SDK that it should look outside of its own google-cloud-sdk/lib directory for libraries to include.







Note that enabling site packages may cause conflicts with the libraries packaged with the gcloud tool, depending on what you have installed on your system. If you encounter a conflict or some of the other gcloud tool sub-commands that you use stop working, you may need to unset the CLOUDSDK_PYTHON_SITEPACKAGES environment variable.

Was this page helpful? Let us know how we did:

Send feedback about...

Cloud KMS Documentation