Sachin Singh
Sachin Singh

Reputation: 1

Google cloud Bucket access

I have to access the data in google clound bucket to my VM instance (jupyter notebook). I got this error and also getting problems related to this.

ERROR: Python 3 and later is not compatible with the Google Cloud SDK. Please use Python version 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.

Upvotes: 0

Views: 130

Answers (2)

SaraAwad
SaraAwad

Reputation: 31

@Raunak Jhawar I have configured an initialization action script that allow to use python 3.

#!/bin/bash
# from https://gist.githubusercontent.com/nehalecky/9258c01fb2077f51545a/raw/789f08141dc681cf1ad5da05455c2cd01d1649e8/install-py3-dataproc.sh

apt-get -y install python3
echo "export PYSPARK_PYTHON=python3" | tee -a  /etc/profile.d/spark_config.sh  /etc/*bashrc /usr/lib/spark/conf/spark-env.sh
echo "Adding PYTHONHASHSEED=0 to profiles and spark-defaults.conf..."
echo "export PYTHONHASHSEED=0" | tee -a /etc/profile.d/spark_config.sh /etc/*bashrc /usr/lib/spark/conf/spark-env.sh
echo "spark.executorEnv.PYTHONHASHSEED=0" >> /etc/spark/conf/spark-defaults.conf

The issue is irrelevant to python 3

Upvotes: 0

Raunak Jhawar
Raunak Jhawar

Reputation: 1651

The Google cloud SDK is not compatible with Python3 for now. You will have to default to a better version as such 2.7.9 or later to work with the SDK.

Upvotes: 1

Related Questions