Nidhi Gowdra
Nidhi Gowdra

Reputation: 3

Import tensorflow error, no module named tensorflow in Google cloud

Remotely connected to my gcloud vm (compute engine) using ssh through gcloud sdk shell and putty. Created a sample python script as per the quickstart: https://cloud.google.com/tpu/docs/quickstart

Trying to run the script but getting error no module named tensorflow. Have both python 2.7.14 and 3.5.4 installed locally. I can run python scripts locally but not in the gcloud shell.

Any help is greatly appreciated Thanks

Upvotes: 0

Views: 1464

Answers (1)

komarkovich
komarkovich

Reputation: 2329

TensorFlow packages have to be installed if you want to use them.

First you have to install pip if you haven't done so already:

sudo apt-get update
sudo apt-get -y upgrade \
&& sudo apt-get install -y python-pip python-dev

When you have pip installed you have to install the TensorFlow packages:

sudo pip install tensorflow

You can follow step by step tutorial how to set up VM instance with TensorFlow in Google Cloud here

Upvotes: 1

Related Questions