1瘟斜、下載anaconda
https://www.anaconda.com/products/individual#macos
2灾而、跟著流程一步步走就可以了角虫,anaconda安裝成功
3霹崎、安裝TensorFlow。先進(jìn)入終端 。
conda info
conda list
查看當(dāng)前已有環(huán)境:
conda env list
后面和之前就差不多了。
創(chuàng)建新環(huán)境
conda create -n tensorflow1.9 python=3.6
進(jìn)入創(chuàng)建的環(huán)境
conda activate tensorflow1.9
安裝
conda install tensorflow==1.9
或者換源
pip install --index-url https://mirrors.aliyun.com/pypi/simple/ tensorflow==1.9
在新建的環(huán)境中進(jìn)入試一下是否安裝成功
conda activate tensorflow1.9
python
import tensorflow as tf
hello = tf.constant('Hello, TensorFlow!')
sess = tf.Session()
print(sess.run(hello))
4、打開pycharm
project:Documents ---> Python interpreter ---> projection interpreter --> conda environment ---> Existing environment --->
在Interpeter中添加你的環(huán)境中的python.exe的路徑(路徑為…\anaconda\envs\ljtf6(你的環(huán)境名字)\python.exe
在add python interpreter時(shí)双仍,找路徑快捷方法:
打開terminal,輸入指令
source activate tensorflow
which python
參考:
http://www.reibang.com/p/592467dfc7da?from=singlemessage
http://www.reibang.com/p/592467dfc7da?from=singlemessage
https://blog.csdn.net/qq_43629743/article/details/105399552?utm_medium=distribute.pc_relevant.none-task-blog-baidujs_title-1&spm=1001.2101.3001.4242