Have a look to this question or this answer.
To summarise you can add this piece of code:
import os
os.environ["CUDA_VISIBLE_DEVICES"] = "-1"
import tensorflow as tf
Playing with the CUDA_VISIBLE_DEVICES
environment variable is one of if not the way to go whenever you have GPU-tensorflow installed and you don't want to use any GPUs.
You to want either export CUDA_VISIBLE_DEVICES=
or alternatively use a virtualenv with a non-GPU installation of TensorFlow.