# Error importing tensorflow after upgrade to v2

## post by z_m on Jul 21, 2020

> import tensorflow as tf
>
> [libprotobuf FATAL google/protobuf/stubs/common.cc:86] This program was compiled against version 3.7.1 of the Protocol Buffer runtime library, which is not compatible with the installed version (3.8.0). Contact the program author for an update. If you compiled the program yourself, make sure that your headers are from the same version of Protocol Buffers as your link-time library. (Version verification failed in “bazel-out/k8-opt/genfiles/tensorflow/core/framework/tensor_shape.pb.cc”.)
>
> terminate called after throwing an instance of ‘google::protobuf::FatalException’
>
> what(): This program was compiled against version 3.7.1 of the Protocol Buffer runtime library, which is not compatible with the installed version (3.8.0). Contact the program author for an update. If you compiled the program yourself, make sure that your headers are from the same version of Protocol Buffers as your link-time library. (Version verification failed in “bazel-out/k8-opt/genfiles/tensorflow/core/framework/tensor_shape.pb.cc”.)
>
> Aborted (core dumped)

## post by jeremy on Jul 30, 2020

Run the following to remove all packages installed via `pip`, and revert back to the Python packages installed by Lambda Stack:

```bash

sudo rm -rf {~/.local,/usr/local}/{bin/pip,lib/python}*
```

You should then be able to `import tensorflow` successfully.

For Tensorflow 2, you’re going to want to [upgrade to Ubuntu 20.04](https://deeptalk.lambda.ai/t/updating-cudatoolkit-to-10-1/1399/6?u=jeremy).
