![7dd8cce40130cc0451bd5b17c7d3ccf7.png](https://img-blog.csdnimg.cn/img_convert/7dd8cce40130cc0451bd5b17c7d3ccf7.png)
anaconda安装
下载地址:
清华镜像地址
由于tensorflow2.0不支持python3.7版本,因此下载python3.6版本,anaconda和python版本对应关系如下图:
![799fa7320d68d31176f243a6cf64a3d1.png](https://img-blog.csdnimg.cn/img_convert/799fa7320d68d31176f243a6cf64a3d1.png)
下载安装好对应版本anaconda后,通过命令安装tensorflow2.0(等正式版本上线后需要替换):
pip install tensorflow==2.0.0-beta1
如果需要,还可以安装pandas等包:
pip install pandas etc...
jupyter notebook安装
pip install jupyter notebook
生成jupyter notebook配置文件:
jupyter notebook --generate-config
生成密码:
jupyter notebook password
拷贝~/jupyter/jupyter_notebook_config.json中的密码到jupyter_notebook_config.py:
c.NotebookApp.password = 'sha1:%s' # %s替换为自己生成的密码c.NotebookApp.ip = '*' #设置可访问的ip为任意。c.NotebookApp.open_browser = False #设置默认不打开浏览器c.NotebookApp.port = 6666 # 设置端口号c.NotebookApp.notebook_dir = '/your/file/saved/path/' # 设置默认访问的文件路径
启动jupyter notebook:
jupyter notebook # 如需后台运行,则加nohup
python虚拟环境
创建一个新的虚拟环境:
conda create -n tensorflow python=3.6
查看已有的虚拟环境:
conda env list
切换虚拟环境(tensorflow为你自己创建时的名,在此为tensorflow):
source activate tensorflow
在此打开jupyter notebook
![aa0e665adff22be73eb7b52a3660f6a0.png](https://img-blog.csdnimg.cn/img_convert/aa0e665adff22be73eb7b52a3660f6a0.png)
让我们看看有没有成功:
![c336b4df568a1cfe09328bdc9997785e.png](https://img-blog.csdnimg.cn/img_convert/c336b4df568a1cfe09328bdc9997785e.png)
so easy?isn’t it?
关注公众号:【算法与推荐系统】
![e3964f15e72499b156a5de7eac798e79.png](https://img-blog.csdnimg.cn/img_convert/e3964f15e72499b156a5de7eac798e79.png)