1、下载anaconda
https://www.anaconda.com/products/individual#macos
image.png2、跟着流程一步步走就可以了,anaconda安装成功
3、安装TensorFlow。先进入终端 。
conda info
conda list
查看当前已有环境:
conda env list
后面和之前就差不多了。
创建新环境
conda create -n tensorflow1.9 python=3.6
进入创建的环境
conda activate tensorflow1.9
安装
conda install tensorflow==1.9
或者换源
pip install --index-url https://mirrors.aliyun.com/pypi/simple/ tensorflow==1.9
在新建的环境中进入试一下是否安装成功
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中添加你的环境中的python.exe的路径(路径为…\anaconda\envs\ljtf6(你的环境名字)\python.exe
在add python interpreter时,找路径快捷方法:
打开terminal,输入指令
source activate tensorflow
which python
参考:
https://www.jianshu.com/p/592467dfc7da?from=singlemessage
https://www.jianshu.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
网友评论