Hi,
I am trying to install google cloud on a server as an ordinary user. The server has linux (Red Hat 4.4.7-18 x86_64) installed and the default python version on the server is python2.6.
I downloaded python2.7 and set its path in my .bash.rc file, so I get:
programs$ python --version
Python 2.7.13
As suggested, I also set the CLOUDSDK_PYTHON variable in my .bash.rc file:
CLOUDSDK_PYTHON="/Volumes/Users/pc/programs/Python-2.7.13/bin"
I opened a new shell, and tried both the curl and the download from tar.gz version of the install script, but get an error:
programs$ curl https://sdk.cloud.google.com | bash
`Welcome to the Google Cloud SDK!
WARNING: Python 2.6.x is no longer officially supported by the Google Cloud SDK
and may not function correctly. Please upgrade to Python 2.7.x
If you have a compatible Python interpreter installed, you can use it by setting
the CLOUDSDK_PYTHON environment variable to point to it.
Traceback (most recent call last):
File "/Volumes/Users/pc/programs/google-cloud-sdk/bin/bootstrapping/install.py", line 8, in
import bootstrapping
File "/Volumes/Users/pc/programs/google-cloud-sdk/bin/bootstrapping/bootstrapping.py", line 19, in
from googlecloudsdk.core import execution_utils
File "/Volumes/Users/pc/programs/google-cloud-sdk/lib/googlecloudsdk/core/execution_utils.py", line 28, in
from googlecloudsdk.core import log
File "/Volumes/Users/pc/programs/google-cloud-sdk/lib/googlecloudsdk/core/log.py", line 626, in
_log_manager = _LogManager()
File "/Volumes/Users/pc/programs/google-cloud-sdk/lib/googlecloudsdk/core/log.py", line 379, in __init__
self.Reset(sys.stdout, sys.stderr)
File "/Volumes/Users/pc/programs/google-cloud-sdk/lib/googlecloudsdk/core/log.py", line 391, in Reset
json_formatter = _JsonFormatter(REQUIRED_STRUCTURED_RECORD_FIELDS)
File "/Volumes/Users/pc/programs/google-cloud-sdk/lib/googlecloudsdk/core/log.py", line 237, in __init__
super(_JsonFormatter, self).__init__()
TypeError: super() argument 1 must be type, not classobj
`
However, when I check the environment variable, I see python 2.7:
programs$ echo $CLOUDSDK_PYTHON
/Volumes/Users/pc/programs/Python-2.7.13/bin
What am I doing wrong? Is there a manual/FAQ/guide that I can follow?
many thanks!
The CLOUDSDK_PYTHON value needs to be the filename of the interpreter, rather than the directory containing the interpreter. Also, you should make sure the variable is actually exported in the Unix shell. Try this:
export CLOUDSDK_PYTHON=/Volumes/Users/pc/programs/Python-2.7.13/bin/python
Hi,
Thanks for the reply! I still seem to be getting the same error:
`Welcome to the Google Cloud SDK!
Traceback (most recent call last):
File "/Volumes/Users/pc/programs/google-cloud-sdk/bin/bootstrapping/install.py", line 8, in
import bootstrapping
File "/Volumes/Users/pc/programs/google-cloud-sdk/bin/bootstrapping/bootstrapping.py", line 17, in
import oauth2client.contrib.gce as gce
File "/Volumes/Users/pc/programs/google-cloud-sdk/lib/third_party/oauth2client/contrib/gce.py", line 23, in
import httplib2
File "/Volumes/Users/pc/programs/google-cloud-sdk/lib/third_party/httplib2/__init__.py", line 952, in
class HTTPSConnectionWithTimeout(httplib.HTTPSConnection):
AttributeError: 'module' object has no attribute 'HTTPSConnection'
programs$ echo $CLOUDSDK_PYTHON
/Volumes/Users/pc/programs/Python-2.7.13/bin/python`
Could it be some other issue?
It could be. The logic in the installer is a bit complicated. Cloud SDK is actually a separate product and team from the Cloud Client Libraries (which this is), so if we can't figure this out, can you refile this bug at their bug tracker: https://issuetracker.google.com/issues/new?component=187143 so that a more expert person can look at it?
One thing that might help is to run the installer with '-x'. I.e. run bash -x /Volumes/Users/pc/programs/google-cloud-sdk/install.sh. This should print out exactly what it thinks the CLOUDSDK_PYTHON variable is, and what it's trying to do with it.
Thanks for taking the time to help!
Here is what I get when I run it with the '-x' option:
`google-cloud-sdk$ bash -x /Volumes/Users/pc/programs/google-cloud-sdk/install.sh
thanks!!
It looks like the variable is not "exported" to the installer process. Can you run the following at the command line?
echo $SHELL and make sure it prints /bin/bash and not some other shell like csh or zshdeclare -p CLOUDSDK_PYTHON and make sure the variable is exported. A '-x' will show up if it is exported, otherwise run export CLOUDSDK_PYTHON.Also, since you're on RedHat, have you tried the prepackaged 'yum' package described here: https://cloud.google.com/sdk/downloads#yum ?
I tried installing from yum, but it said that I don't have root permissions. Here are my other attempts from installing from a tarball, and trying to install using curl:
google-cloud-sdk$ ./install.sh
Welcome to the Google Cloud SDK!
Traceback (most recent call last):
File "/Volumes/Users/pc/programs/google-cloud-sdk/bin/bootstrapping/install.py", line 8, in
import bootstrapping
File "/Volumes/Users/pc/programs/google-cloud-sdk/bin/bootstrapping/bootstrapping.py", line 17, in
import oauth2client.contrib.gce as gce
File "/Volumes/Users/pc/programs/google-cloud-sdk/lib/third_party/oauth2client/contrib/gce.py", line 23, in
import httplib2
File "/Volumes/Users/pc/programs/google-cloud-sdk/lib/third_party/httplib2/__init__.py", line 952, in
class HTTPSConnectionWithTimeout(httplib.HTTPSConnection):
AttributeError: 'module' object has no attribute 'HTTPSConnection'
google-cloud-sdk$ declare -p CLOUDSDK_PYTHON
declare -x CLOUDSDK_PYTHON="/Volumes/Users/pc/programs/Python-2.7.13/bin/python"
$ curl https://sdk.cloud.google.com | bash
/Volumes/Users/pc/programs/google-cloud-sdk/install.sh
shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
Welcome to the Google Cloud SDK!
Traceback (most recent call last):
File "/Volumes/Users/pc/programs/google-cloud-sdk/bin/bootstrapping/install.py", line 8, in
import bootstrapping
File "/Volumes/Users/pc/programs/google-cloud-sdk/bin/bootstrapping/bootstrapping.py", line 17, in
import oauth2client.contrib.gce as gce
File "/Volumes/Users/pc/programs/google-cloud-sdk/lib/third_party/oauth2client/contrib/gce.py", line 23, in
import httplib2
File "/Volumes/Users/pc/programs/google-cloud-sdk/lib/third_party/httplib2/__init__.py", line 952, in
class HTTPSConnectionWithTimeout(httplib.HTTPSConnection):
AttributeError: 'module' object has no attribute 'HTTPSConnection'
This repository is not about the "Google Cloud SDK": please report issues for that package in its issue tracker.
Hi,
Have you had solved this problem now? I have the same problem now, seems don't know how to fix this problem...below is my error display:
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Do you want to help improve the Google Cloud SDK (Y/n)? n
Traceback (most recent call last):
File "xx/google-cloud-sdk/bin/bootstrapping/install.py", line 218, in
main()
File "xx/google-cloud-sdk/bin/bootstrapping/install.py", line 193, in main
Prompts(pargs.usage_reporting)
File "xx/google-cloud-sdk/bin/bootstrapping/install.py", line 116, in Prompts
scope=properties.Scope.INSTALLATION)
File "xx/google-cloud-sdk/lib/googlecloudsdk/core/properties.py", line 1832, in PersistProperty
config.EnsureSDKWriteAccess()
File "xx/google-cloud-sdk/lib/googlecloudsdk/core/config.py", line 192, in EnsureSDKWriteAccess
raise exceptions.RequiresAdminRightsError(sdk_root)
googlecloudsdk.core.exceptions.RequiresAdminRightsError: You cannot perform this action because you do not have permission to modify the Google Cloud SDK installation directory [xx/google-cloud-sdk].
Re-run the command with sudo: sudo xx/google-cloud-sdk/bin/gcloud ...
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
when I switch to root, it still has some problems:
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Do you want to help improve the Google Cloud SDK (Y/n)? n
Traceback (most recent call last):
File "xx/google-cloud-sdk/bin/bootstrapping/install.py", line 218, in
main()
File "xx/google-cloud-sdk/bin/bootstrapping/install.py", line 196, in main
Install(pargs.override_components, pargs.additional_components)
File "xx/google-cloud-sdk/bin/bootstrapping/install.py", line 141, in Install
_CLI.Execute(['--quiet', 'components', 'list'])
File "xx/google-cloud-sdk/lib/googlecloudsdk/calliope/cli.py", line 814, in Execute
self._HandleAllErrors(exc, command_path_string, specified_arg_names)
File "xx/google-cloud-sdk/lib/googlecloudsdk/calliope/cli.py", line 852, in _HandleAllErrors
exceptions.HandleError(exc, command_path_string, self.__known_error_handler)
File "xx/google-cloud-sdk/lib/googlecloudsdk/calliope/exceptions.py", line 488, in HandleError
core_exceptions.reraise(exc)
File "xx/google-cloud-sdk/lib/googlecloudsdk/core/exceptions.py", line 109, in reraise
raise exc_value
httplib2.python2.httplib2.SSLHandshakeError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:661)
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Can anyone help to look at this issue? thanks!
Most helpful comment
The
CLOUDSDK_PYTHONvalue needs to be the filename of the interpreter, rather than the directory containing the interpreter. Also, you should make sure the variable is actually exported in the Unix shell. Try this: