Python在ubuntu16.04上环境搭建
1、anaconda3安装
mkdir anaconda
cd anaconda
wget https://repo.continuum.io/archive/Anaconda3-4.4.0-Linux-x86_64.sh
bash Anaconda3-4.4.0-Linux-x86_64.sh
安装过程中问你是否将anaconda安装路径加入到环境变量(.bashrc)中,一定要输入no!!。否则就不能正常导入安装包,若点了yes,做如下更改:
sudo vim ~/.bashrc
#将最后一行的Anaconda路径删除掉
source ~/.bashrc
2、生成jupyter notebook配置文件
source anaconda3/bin/activate
jupyter notebook --generate-config
3、生成密码(sha1:....)
ipython
from notebook.auth import passwd
passwd()
exit()
source deactivate
4、编辑jupyter_notebook_config.py文件
sudo vi ~/.jupyter/jupyter_notebook_config.py
---
c.NotebookApp.ip='*'
c.NotebookApp.password = u'sha1:39cf69c03fea:68e4e1af1c50d52eb4def39c1ab6ff360386a09c'
c.NotebookApp.open_browser = False
c.NotebookApp.port =8888
---
5、安装tensorflow和R内核
source anaconda3/bin/activate
pip install tensorflow
conda create -n my-r-env -c r r-essentials
source deactivate
6、启动jupyter notebook
source anaconda3/bin/activate
source activate my-r-env
jupyter notebook
source deactivate
source deactivate为退出anaconda3运行环境