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:
- https://www.tensorflow.org/install/install_mac#the_url_of_the_tensorflow_python_package
- https://thkim.org/tensorflow/tensorflowinstallation/tensorflowinstallationvirtualenv/
- https://github.com/tensorflow/tensorflow/issues/647
- https://codedump.io/share/6Oq22H5Uhoab/1/virtualenv-tensorflow-instalation-validation-with-importerror-no-module-named-tensorflow
- https://stackoverflow.com/questions/43647090/virtualenv-tensorflow-installation-validation-with-importerror-no-module-named
- http://python-guide-pt-br.readthedocs.io/en/latest/dev/virtualenvs/
- https://hackercodex.com/guide/python-development-environment-on-mac-osx/
- http://sourabhbajaj.com/mac-setup/Python/virtualenv.html
The journey:
Downloading TensorFlow
Install and update
Removing Anaconda
tensorflow library couldn’t be recognized. Installing gpu version
installing for python 2.7
reinstalling python and fixing the PATH
installing virtualenv
installing tensorflow on virtualenv
tensorflow had been successfully installed on virtualenv
tensorflow library still not recognized
finally figure out how to activate the virtualenv
library recognized but there were errors!
reinstall tensorflow to the activated virtualenv, and it worked!
YES!!! 🙂 Now I’m ready to explore! 😉
azka 2:46 pm on August 1, 2017 Permalink |
123456789