To apply tensorflow in sublime text 3 might have some issues due to comptability among python 2.7, built system in sublime text 3, and tensorflow itself.
Follow the following steps we can still make it happen:
1. Install Python 2.7, not the default one of MAC. We need to install another 2.7 under the path “/Library/Frameworks/Python.framework/Versions/2.7/bin/python”
2. Use terminal to install tensorflow for python 2.7:
“pip install tensorflow”
3. After the installment is over, we need to upgrade the tensorfow for python 2.7 to the latest version manually:
“pip install –upgrade tensorflow” in terminal.
4. Build the new system of python 2.7 in sublime text 3:
5. Run the script under python 2.7 in sublime text 3.
Now it should work, even when we choose python 3.6 as the built system. Still recommend python2.7 when we apply tensorflow in sublime text since TensorFlow still has functions not compatible for 3.6.