For the sake of completeness I will answer this partly because:
1) the first duplicate suggested (although correct) is for Mac
2) the second duplicate suggestion is for Django and returns a different error.
As Jean François Fabre said in his comments use
sudo pip install --upgrade gcloud`
Without this command pip
cannot access the root dictionary to write the appropriate files. This is due to security reasons where nothing can be written in the root dictionary unless sudo
prefix is specified so that only the superuser can allow security privileges.
See Wikipedia for info on the sudo
command