安装Anaconda
安装Anaconda后配置环境变量
系统变量Path加上D:\Anaconda3;D:\Anaconda3\Scripts;D:\Anaconda3\Library\bin
cmd中判断,嘿嘿安装好了python和numpy。
![](https://img.laitimes.com/img/__Qf2AjLwojIjJCLyojI0JCLi8zZuBnLxgjNzATOycTM3ITMxkTMwIzLc52YucWbp5GZzNmLn9Gbi1yZtl2Lc9CX6MHc0RHaiojIsJye.png)
在Spyder里用代码检测:
from skimage import io
img = io.imread('C:/Users/YOGA/Desktop/1.png')
io.imshow(img)
最后在console方框里显示(可能压缩了?):
安装TensorFlow
python版本是37的巨麻烦,网上一般的教程都是36 35,还有说只支持35的,不清楚。。。
- conda create -n tensorflow python=3.7创建一个TensorFlow的环境,然后conda activate tensorflow,激活环境。
- 通过这个链接https://pypi.org/project/tensorflow/#files下载到一个文件夹中。
- cmd进入文件夹,“pip install -i https://pypi.tuna.tsinghua.edu.cn/simple/ --upgrade tensorflow-2.0.0-cp37-cp37m-win_amd64.whl”,其中链接是清华镜像,可改成其他路径。(pip install的话下载速度太慢,超过时间会报错)
阿里云 http://mirrors.aliyun.com/pypi/simple/
中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple/
豆瓣(douban) http://pypi.douban.com/simple/
清华大学 https://pypi.tuna.tsinghua.edu.cn/simple/
中国科学技术大学 http://pypi.mirrors.ustc.edu.cn/simple/
检测tf
因为装的是tf2.0版本,指令更新了,输入下列代码,若输出‘Hello,TensorFlow!’则已经安装成功嘻嘻
import tensorflow as tf
tf.compat.v1.disable_eager_execution()
hello = tf.constant('Hello, TensorFlow!')
sess = tf.compat.v1.Session()
print(sess.run(hello))