1)terminal
2)依次執行如下代碼
conda create -n tensorflow python=3.5
source activate tensorflow
conda install pandas matplotlib jupyter notebook scipy scikit-learn
conda install -c conda-forge tensorflow
退出該環境時“source deactivate tensorflow”
3)驗證是否安裝好? terminal——jupyter notebook
import tensorflow as tf
# Create TensorFlow object called tensor
hello_constant = tf.constant('Hello World!')
with tf.Session() as sess:
# Run the tf.constant operation in the session
output = sess.run(hello_constant)
print(output)
若輸出 b'Hello World!' 即為安裝成功!