在tensorflow中安装并启动jupyter的方法

博主遇到一个问题,在anaconda中安装并配置好tensorflow和opencv后,直接输入

jupyter notebook

启动jupyter notebook在jupyter notebook中输入命令,如import tensorflow并不能调用tensorflow的开发包。

原因是:如果此时直接启动jupyter,此时的jupyter是基于整个anaconda的python,而不是对应的tensorflow虚拟环境,因此进入此虚拟环境后需要重新安装jupyter notebook

输入命令:

/bin/bash

./bin/activate

source activate tensorflow

进入虚拟环境以后,输入命令:

conda install jupyter

直到安装包下载完成,在tensorflow目录下就安装了jupyter,此时在tensorflow虚拟环境下,输入命名:

jupyter notebook

此时就可以调用tensorflow和opencv的库,如下图:

猜你喜欢

转载自blog.csdn.net/weixin_36670529/article/details/83505743