When I installed TensowFlow using pip and tried to check the operation, the following error occurred. Thanks to this guy, I was able to confirm the operation of TensowFlow. You can already get it at the stage of importing tensorflow ...
File "<stdin>", line 1, in <module> File "/Library/Python/2.7/site-packages/tensorflow/__init__.py", line 23, in <module> from tensorflow.python import * File "/Library/Python/2.7/site-packages/tensorflow/python/__init__.py", line 49, in <module> from tensorflow import contrib File "/Library/Python/2.7/site-packages/tensorflow/contrib/__init__.py", line 23, in <module> from tensorflow.contrib import layers File "/Library/Python/2.7/site-packages/tensorflow/contrib/layers/__init__.py", line 68, in <module> from tensorflow.contrib.layers.python.layers import * File "/Library/Python/2.7/site-packages/tensorflow/contrib/layers/python/layers/__init__.py", line 22, in <module> from tensorflow.contrib.layers.python.layers.initializers import * File "/Library/Python/2.7/site-packages/tensorflow/contrib/layers/python/layers/initializers.py", line 24, in <module> from tensorflow.python.ops import random_ops File "/Library/Python/2.7/site-packages/tensorflow/python/ops/random_ops.py", line 23, in <module> from tensorflow.python.framework import ops File "/Library/Python/2.7/site-packages/tensorflow/python/framework/ops.py", line 39, in <module> from tensorflow.python.framework import versions File "/Library/Python/2.7/site-packages/tensorflow/python/framework/versions.py", line 22, in <module> from tensorflow.python import pywrap_tensorflow File "/Library/Python/2.7/site-packages/tensorflow/python/pywrap_tensorflow.py", line 28, in <module> _pywrap_tensorflow = swig_import_helper() File "/Library/Python/2.7/site-packages/tensorflow/python/pywrap_tensorflow.py", line 24, in swig_import_helper _mod = imp.load_module('_pywrap_tensorflow', fp, pathname, description) ImportError: numpy.core.multiarray failed to import
To summarize the contents of this error, something like "The version of numpy I loaded did not work well due to duplication".
After investigating various things, the method is "Uninstall all numpy and reinstall it". First, see the following blog, move to the corresponding folder and uninstall. http://sechiro.hatenablog.com/entry/2016/04/02/Mac%E3%81%ABTensorFlow%E3%82%92%E5%85%A5%E3%82%8C%E3%82%88%E3%81%86%E3%81%A8%E3%81%97%E3%81%9F%E3%82%89%E3%80%81Numpy%E3%81%AE%E3%82%A8%E3%83%A9%E3%83%BC%E3%81%8C%E5%87%BA%E3%81%9F%E3%81%AE%E3%81%A7
However, the content of the error message did not change, so I searched for information and found another candidate for the installation location of numpy. Delete + reinstall according to the following blog. http://d.hatena.ne.jp/aremokoremo/20140507/1399475248
Then I was able to import TensowFlow successfully, and I was able to start the programming life with TensowFlow.
Check if there is numpy in the following two folders. Then delete all numpy from the following folders and then reinstall the new numpy.