4

I am trying to install tensor flow on my mac with

sudo pip install https://storage.googleapis.com/tensorflow/mac/tensorflow-0.5.0-py2-none-any.whl

And I get the error:

Traceback (most recent call last):

File "<string>", line 16, in <module>

IOError: [Errno 2] No such file or directory: '/var/folders/9y/r7zhtk2s1s90hwcty1d6964w0000gn/T/pip-pnXFjW-build/setup.py'

I am on OSX 10.11.1 and all the development tools, pip and python2.7 are installed.

Luca
  • 10,458
  • 24
  • 107
  • 234
  • 1
    For some reason, TensorFlow seems to install best in a virtual environment. See [this](http://stackoverflow.com/questions/33870404/problems-installing-tensorflow-on-mac?rq=1) and [this](http://stackoverflow.com/questions/33730259/tensorflow-installaion-error-on-mac?rq=1) for example. If you're unused to virtualenvs, I recommend using [Anaconda](https://www.continuum.io/downloads). – Matt Hall Nov 25 '15 at 20:21
  • 2
    Thanks. I installed it using anaconda now – Luca Nov 25 '15 at 21:33
  • You should make the comment about using anaconda an answer. People don't always look into the comments for answers. – Guy Coder Dec 18 '15 at 13:38
  • How did you use anaconda to install it? I'm having trouble with that. – Adam_G Dec 30 '15 at 04:35
  • @Adam_G I used the wheel file provided. For example, after installing anaconda, run: conda install --name ml -c https://storage.googleapis.com/tensorflow/mac/tensorflow-0.5.0-py2-none-any.whl This, for example, installs tensorflow 0.5.0 in my 'ml' conda environment. – Luca Dec 30 '15 at 10:43

1 Answers1

1

This may not be exactly the solution you're looking for, but I personally spent the last two hours diagnosing a similar issue where TensorFlow wouldn't work after correctly installing and having its packages satisfied.

It was throwing one of the strange _IO module import errors that seemed to be saying python was working correctly, and I ended up tracing it back all the way to the System Integrity Protection issue introduced in El Cap.

See here for easy fix that will let pip work correctly again.

For those that are curious, Apple introduced SIP to make sure no user accidentally hurts system files, but in the process it makes it trickier for users to run commands as root

Also, remember to run

sudo easy_install --upgrade six

and

sudo pip install https://storage.googleapis.com/tensorflow/mac/tensorflow-0.5.0-py2-none-any.whl

After disabling SIP to make sure you patch up any requirements. You may need to uninstall some pip packages if this fails for some reason.

As a final note, you should be off the ground if, in the python shell, you can

import tensorflow as tf

and it doesn't throw any errors.

Community
  • 1
  • 1
Shelby Vanhooser
  • 58
  • 1
  • 1
  • 5