Linux 远程Ipython Notebook
Ipython Notebook
现在已经改名为Ipython jupyter
,是最知名最好用的python数据分析工具。
下面讲讲怎么在linux下安装ipython jupyter,以及远程访问,我这里是在虚拟机中配置ipython,windows访问虚拟机中的ipython jupyter。
1.安装anaconda
anaconda是目前python数据分析最好用的发行版,集成了很多常用的数据分析模块,如果是自己安装python环境,坑很多的。
在linux下安装也很简单,将anaconda.sh
上传到linux后,执行 bash anaconda.sh
,根据提示安装即可,最后一部是询问是否将python加入环境变量,选择yes,当然你也可以在安装完后手动添加到bash中。
下面的安装完后的.bashrc
添加的python环境变量:
# added by Anaconda3 4.2.0 installer
export PATH="/home/zhenyu/anaconda3/bin:$PATH"
2.配置ipython jupyter
2.1.生成配置文件
# 生成配置文件
jupyter notebook --generate-config
# 此时生成配置文件:
# Writing default config to: /home/zhenyu/.jupyter/jupyter_notebook_config.py
# 创建登录密码
# 打开ipython,生成密钥
$ ipython
from notebook.auth import passwd
passwd()
Enter password:
Verify password:
Out[2]: 'sha1:6f6193fcfbd5:614c4ba185334868fc8bbce2e9890b3ef7d1a79b'