1

I'm trying to use TensorFlow on my Mac.

I'm in terminal and have followed all directions on the Tensorflow Install page until "Run a short test program"

I'm attempting to write

import tensorflow as tf

But I receive the following message

RuntimeError: module compiled against API version 0xa but this version of numpy is 0x9
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/robilin/Library/Python/2.7/lib/python/site-packages/tensorflow/__init__.py", line 24, in <module>
    from tensorflow.python import *
  File "/Users/robilin/Library/Python/2.7/lib/python/site-packages/tensorflow/python/__init__.py", line 51, in <module>
    from tensorflow.python import pywrap_tensorflow
  File "/Users/robilin/Library/Python/2.7/lib/python/site-packages/tensorflow/python/pywrap_tensorflow.py", line 52, in <module>
    raise ImportError(msg)
ImportError: Traceback (most recent call last):
  File "/Users/robilin/Library/Python/2.7/lib/python/site-packages/tensorflow/python/pywrap_tensorflow.py", line 41, in <module>
    from tensorflow.python.pywrap_tensorflow_internal import *
  File "/Users/robilin/Library/Python/2.7/lib/python/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 28, in <module>
    _pywrap_tensorflow_internal = swig_import_helper()
  File "/Users/robilin/Library/Python/2.7/lib/python/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 24, in swig_import_helper
    _mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)
ImportError: numpy.core.multiarray failed to import


Failed to load the native TensorFlow runtime.

Any help would be great!

1
  • please format your exception so that others can read it Commented May 5, 2017 at 22:30

2 Answers 2

1

It seems that you have an incompatible numpy version.

You need to upgrade numpy

Sign up to request clarification or add additional context in comments.

Comments

0

You can run

pip install --upgrade numpy

to upgrade numpy to its latest version

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.