Installing TensorFlow on MacOS Sierra

I can’t remember every steps but I need to leave some notes that I can refer to later 🙂 I just put everything I can remember here 🙂

The directory:

cd /usr/local/lib/python2.7/site-packages/tensorflow/bin
source activate tensorflow

code example to test

>> import tensorflow as tf
>>> hello = tf.constant(‘Hello, TensorFlow!’)
>>> sess = tf.Session()
>>> print sess.run(hello)
Hello, TensorFlow!
>>> a = tf.constant(10)
>>> b = tf.constant(32)
>>> print sess.run(a+b)
42
>>> quit()
(tensorflow) CG-MacBook-Pro-2:bin Marisa$ deactivate

Activating virtualenv

$ cd /path/to/tensorflow/bin
$ source activate tensorflow
$ python
>>> import tensorflow as tf
>>> print(tf.__version__)
1.0.1

Important links:

  1. https://www.tensorflow.org/install/install_mac#the_url_of_the_tensorflow_python_package
  2. https://thkim.org/tensorflow/tensorflowinstallation/tensorflowinstallationvirtualenv/
  3. https://github.com/tensorflow/tensorflow/issues/647
  4. https://codedump.io/share/6Oq22H5Uhoab/1/virtualenv-tensorflow-instalation-validation-with-importerror-no-module-named-tensorflow
  5. https://stackoverflow.com/questions/43647090/virtualenv-tensorflow-installation-validation-with-importerror-no-module-named
  6. http://python-guide-pt-br.readthedocs.io/en/latest/dev/virtualenvs/
  7. https://hackercodex.com/guide/python-development-environment-on-mac-osx/
  8. http://sourabhbajaj.com/mac-setup/Python/virtualenv.html

The journey:

Downloading TensorFlow

Bildschirmfoto 2017-05-25 um 7.09.57 PM

Install and update

Bildschirmfoto 2017-05-25 um 7.18.58 PM

Removing Anaconda

Bildschirmfoto 2017-05-25 um 7.25.06 PM

tensorflow library couldn’t be recognized. Installing gpu version

Bildschirmfoto 2017-05-25 um 8.01.42 PM

installing for python 2.7

Bildschirmfoto 2017-05-25 um 9.57.24 PM

reinstalling python and fixing the PATH

Bildschirmfoto 2017-05-25 um 10.25.47 PM

installing virtualenv

Bildschirmfoto 2017-05-25 um 11.33.43 PM

installing tensorflow on virtualenv

Bildschirmfoto 2017-05-26 um 1.14.44 PM

tensorflow had been successfully installed on virtualenv

Bildschirmfoto 2017-05-26 um 1.24.11 PM

tensorflow library still not recognized

Bildschirmfoto 2017-05-26 um 1.32.30 PM

finally figure out how to activate the virtualenv

Bildschirmfoto 2017-05-26 um 1.50.15 PM

library recognized but there were errors!

Bildschirmfoto 2017-05-26 um 1.50.42 PM

reinstall tensorflow to the activated virtualenv, and it worked!

Bildschirmfoto 2017-05-26 um 1.54.14 PM

YES!!! 🙂 Now I’m ready to explore! 😉

Bildschirmfoto 2017-05-26 um 2.16.10 PM

Advertisements