安装conda
在anaconda官网下载https://www.anaconda.com/distribution/,我下载的是Anaconda3-2019.03-Linux-x86_64.sh安装包。在ubuntu终端上直接执行sh Anaconda3-2019.03-Linux-x86_64.sh,建议使用root用户进行安装,并在/etc/profile配置全局的conda安装目录的path。
export PATH=/data/anaconda3/bin:$PATH:$JAVA_HOME/bin:.
设置jupyter notebook访问权限
生成密码hash(默认使用sha1)
HaDoop@deeplearn39:~/dog_project$ ipython
Python 3.7.1 (default, Dec 14 2018, 19:28:38)
Type 'copyright', 'credits' or 'license' for more information
IPython 7.2.0 -- An enhanced Interactive Python. Type '?' for help.
In [1]: from notebook.auth import passwd
In [2]: passwd()
Enter password:
Verify password:
Out[2]: 'sha1:858b516fbc2e:1b4369ae6c6348381993339735e6b41a24be8f94'
In [3]: quit()
注意,sha1:858b516fbc2e:1b4369ae6c6348381993339735e6b41a24be8f94在接下来有作用,这仅是生成hash,实际需要配置到访问的配置文件中。
配置密码配置
HaDoop@deeplearn39:~$nano ~/.jupyter/jupyter_notebook_config.py
根据提示,执行ctrl+x,然后按Y,则保存密码配置。
启动服务
HaDoop@deeplearn39:~/udacity/dog_project$ jupyter notebook --ip=0.0.0.0 --no-browser --allow-root
[I 10:49:58.283 NotebookApp] JupyterLab extension loaded from /data/anaconda3/lib/python3.7/site-packages/jupyterlab
[I 10:49:58.283 NotebookApp] JupyterLab application directory is /data/anaconda3/share/jupyter/lab
[I 10:49:58.285 NotebookApp] Serving notebooks from local directory: /data/hadoop_home/udacity/dog_project
[I 10:49:58.285 NotebookApp] The Jupyter Notebook is running at:
[I 10:49:58.285 NotebookApp] http://(deeplearn39 or 127.0.0.1):8888/
[I 10:49:58.285 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
浏览器访问
不小心帮鹅厂打了个广告了。在输入框输入刚才设置的密码,则可以成功,登录。新建一个ipynb测试下环境是否可用,见下图。
一切就绪,可以开始新历程了