Invalid ELF header tensorflow
Question: I first tried installing tensorflow via the following:

    
    
    user@WS1:~/July 2016$ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow-0.9.0-cp27-none-linux_x86_64.whl
    
    user@WS1:~/July 2016$ pip install --upgrade $TF_BINARY_URL
    

Then I tried using a (slightly modified version for linux and tensorflow
0.9.0) solution from [iRapha
here](https://github.com/tensorflow/tensorflow/issues/135):

    
    
    user@WS1:~/July 2016$ wget https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow-0.9.0-cp27-none-linux_x86_64.whl
    
    user@WS1:~/July 2016$ pip install tensorflow-0.9.0-cp27-none-linux_x86_64.whl
    

Then I tried to test whether tensorflow was successfully installed. The
following output shows that there is an 'invalid ELF header' error.

    
    
    user@WS1:~/July 2016$ python
    Python 2.7.12 |Anaconda 2.5.0 (64-bit)| (default, Jul  2 2016, 17:42:40) 
    [GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] on linux2
    >>> import tensorflow
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "/export/mlrg/caugusta/anaconda2/lib/python2.7/site-packages   /tensorflow/__init__.py", line 23, in <module>
        from tensorflow.python import *
      File "/export/mlrg/caugusta/anaconda2/lib/python2.7/site-packages/tensorflow/python/__init__.py", line 48, in <module>
        from tensorflow.python import pywrap_tensorflow
      File "/export/mlrg/caugusta/anaconda2/lib/python2.7/site-packages/tensorflow/python/pywrap_tensorflow.py", line 28, in <module>
    _pywrap_tensorflow = swig_import_helper()
      File "/export/mlrg/caugusta/anaconda2/lib/python2.7/site-packages/tensorflow/python/pywrap_tensorflow.py", line 24, in swig_import_helper
    _mod = imp.load_module('_pywrap_tensorflow', fp, pathname, description)
    ImportError: /export/mlrg/caugusta/anaconda2/lib/python2.7/site-packages/tensorflow/python/_pywrap_tensorflow.so: invalid ELF header
    

I've checked [here](http://stackoverflow.com/questions/5713731/what-does-this-
error-mean-invalid-elf-header). Based on that answer, I tried:

    
    
    user@WS1:~July 2016$ pip install tensorflow
    

Everything says that tensorflow installed successfully, but when I import it
in python I get that invalid ELF header error. Anyone know how I can resolve
this?


Answer: This could happen if you have install tensorflow package which does not match
your platform.

An extreme example would be installing the mac platform package (as seen
below) on linux.

    
    
    export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.10.0rc0-cp35-cp35m-linux_x86_64.whl
    

Just make sure you use the correct platform.

