Import tensorflow error
<p>I installed <strong>tensorflow</strong> using anaconda distribution and I am unable to use the same in python.</p>

<p>When I import tensorflow using <code>import tensorflow</code> I get the following error:</p>

<pre><code>Traceback (most recent call last):
  File "&lt;stdin&gt;", line 1, in &lt;module&gt;
  File "/Users/kaxilnaik/anaconda/lib/python2.7/site-packages/tensorflow/__init__.py", line 23, in &lt;module&gt;
    from tensorflow.python import *
  File "/Users/kaxilnaik/anaconda/lib/python2.7/site-packages/tensorflow/python/__init__.py", line 52, in &lt;module&gt;
    from tensorflow.core.framework.graph_pb2 import *
  File "/Users/kaxilnaik/anaconda/lib/python2.7/site-packages/tensorflow/core/framework/graph_pb2.py", line 16, in &lt;module&gt;
    from tensorflow.core.framework import attr_value_pb2 as tensorflow_dot_core_dot_framework_dot_attr__value__pb2
  File "/Users/kaxilnaik/anaconda/lib/python2.7/site-packages/tensorflow/core/framework/attr_value_pb2.py", line 16, in &lt;module&gt;
    from tensorflow.core.framework import tensor_pb2 as tensorflow_dot_core_dot_framework_dot_tensor__pb2
  File "/Users/kaxilnaik/anaconda/lib/python2.7/site-packages/tensorflow/core/framework/tensor_pb2.py", line 16, in &lt;module&gt;
    from tensorflow.core.framework import tensor_shape_pb2 as tensorflow_dot_core_dot_framework_dot_tensor__shape__pb2
  File "/Users/kaxilnaik/anaconda/lib/python2.7/site-packages/tensorflow/core/framework/tensor_shape_pb2.py", line 22, in &lt;module&gt;
    serialized_pb=_b('\n,tensorflow/core/framework/tensor_shape.proto\x12\ntensorflow\"z\n\x10TensorShapeProto\x12-\n\x03\x64im\x18\x02 \x03(\x0b\x32 .tensorflow.TensorShapeProto.Dim\x12\x14\n\x0cunknown_rank\x18\x03 \x01(\x08\x1a!\n\x03\x44im\x12\x0c\n\x04size\x18\x01 \x01(\x03\x12\x0c\n\x04name\x18\x02 \x01(\tB2\n\x18org.tensorflow.frameworkB\x11TensorShapeProtosP\x01\xf8\x01\x01\x62\x06proto3')
TypeError: __init__() got an unexpected keyword argument 'syntax'
</code></pre>

<p>I tried reinstalling anaconda as well as uninstalling <code>protobuf</code> which I found as an answer somewhere in stackoverflow. </p>

<p>You should uninstall tensorflow as well, and make sure protobuf is uninstalled.  You can try <code>brew uninstall protobuf</code> as well.  Then reinstall protobuf, and tensorflow.  Tensorflow requires protobuf version 3.x</p>

<pre><code>pip install 'protobuf&gt;=3.0.0a3'
</code></pre>

<p>You can test your protobuf version:</p>

<pre><code>import google.protobuf
&gt;&gt;&gt; print google.protobuf.__version__
</code></pre>

python osx python-2.7 tensorflow