Use Jupyter notebook on Fedora 28
生产环境使用 Fedora 28, 并且需要搭建一个 Jupyter 的notebook 方便使用,所搭建的Jupyter 支持单人远程 密码访问
1. 安装
安装 Jupyter , 出错
[root@dhcp-- ~]# pip install jupyter
WARNING: Running pip install with root privileges is generally not a good idea. Try `pip install --user` instead.
.
.
.
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-2.7
copying scandir.py -> build/lib.linux-x86_64-2.7
running build_ext
building '_scandir' extension
creating build/temp.linux-x86_64-2.7
gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE= -fexceptions -fstack-protector-strong --param=ssp-buffer-size= -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE= -fexceptions -fstack-protector-strong --param=ssp-buffer-size= -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -I/usr/include/python2. -c _scandir.c -o build/temp.linux-x86_64-2.7/_scandir.o
gcc: error: /usr/lib/rpm/redhat/redhat-hardened-cc1: No such file or directory
error: command 'gcc' failed with exit status ----------------------------------------
Command "/usr/bin/python2 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-8KqVrv/scandir/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-IrivkV-record/install-record.txt --single-version-externally-managed --compile" failed with error code in /tmp/pip-build-8KqVrv/scandir/
You are using pip version 9.0., however version 10.0. is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
安装 redhat-rpm-config
[root@dhcp-- ~]# yum install redhat-rpm-config
安装 python-devel
[root@dhcp-- ~]# yum install python-devel
安装 notebook
[root@dhcp-- ~]# pip install notebook
2. 运行
生成token 运行:
[root@dhcp-- ~]# jupyter notebook --allow-root
[I ::13.108 NotebookApp] Serving notebooks from local directory: /root
[I ::13.108 NotebookApp] active kernels
[I ::13.108 NotebookApp] The Jupyter Notebook is running at:
[I ::13.108 NotebookApp] http://localhost:8888/?token=60bbeb5c2ef4a8c0e15cfcb85588e265a185b46949e051e7
生成配置文件:
[root@dhcp-- ~]# jupyter notebook --generate-config
Writing default config to: /root/.jupyter/jupyter_notebook_config.py
3. 配置
(1)在配置文件中配置密码:
c.NotebookApp.password = u'sha1:12a39cedb875:c97d0285f90cec397fffe96f11e5ef5e56e90fa2'
其中:加密使用
from notebook.auth import passwd 中 password 方法进行加密
可以在 python shell 中生成 或者直接使用:
[root@dhcp-- ~]# jupyter notebook password
设置密码,并直接写到配置文件中
如果没有设置密码 可以使用 jupyter notebook list 命令来查看 token 从而进行访问。
(2)允许所有ip地址访问
# Set ip to '*' to bind on all interfaces (ips) for the public server
c.NotebookApp.ip = '*' or c.NotebookApp.ip = '0.0.0.0' (2020年4月20日更新)
c.NotebookApp.password = u'sha1:bcd259ccf...<your hashed password here>'
c.NotebookApp.open_browser = False # It is a good idea to set a known, fixed port for server access
c.NotebookApp.port = 8888
(3) 保证 IPython Clusters 运行
[root@dhcp-- ~]# pip install ipyparallel
后台运行:
[root@dhcp-- ~]# nohup jupyter notebook --allow-root &
具体对 notebook 外观的修改,可以从源代码角度进行修改,进行定制,这里就不多讲了。
如果 需要添加 防火墙规则,可以根据实际需要的端口进行添加。
更多配置请参考:
https://jupyter-notebook.readthedocs.io/en/stable/public_server.html#securing-a-notebook-server
https://github.com/ipython/ipyparallel
https://jupyterhub.readthedocs.io/en/latest/
保持更新,转载请注明出处。
Use Jupyter notebook on Fedora 28的更多相关文章
- ubuntu下设置jupyter notebook 2017年07月29日 19:28:34 小旋锋 阅读数:8329 标签: ubuntu 更多 个人分类: python 二三事 来源:http://blog.csdn.net/suzyu12345/article/details/51037905 Ipython Notebook现在已经改名为Ipython jupyter,是最知名最好用的
ubuntu下设置jupyter notebook 来源:http://blog.csdn.net/suzyu12345/article/details/51037905 Ipython No ...
- 27个Jupyter Notebook使用技巧及快捷键(翻译版)
Jupyter Notebook Jupyter Notebook 以前被称为IPython notebook.Jupyter Notebook是一款能集各种分析包括代码.图片.注释.公式及自己画的图 ...
- Jupyter Notebook中的快捷键
1.快捷键 Jupyter Notebook 有两种键盘输入模式.编辑模式,允许你往单元中键入代码或文本:这时的单元框线是绿色的.命令模式,键盘输入运行程序命令:这时的单元框线是灰色. 命令模式 (按 ...
- Jupyter Notebook的安装
依赖安装 pandoc texlive-xetex texlive-lang-cjk 安装Jupyter Notebook 本文不讲解在Anaconda中安装. 安装方法 sudo python -m ...
- 使用Jupyter Notebook编写技术文档
1.jupyter Notebook的组成 这里它的组件及其工程构成,帮助大家更好的用好jupyter Notebook 组件 Jupyter Notebook结合了三个组件: 笔记本Web应用程序: ...
- 在CentOS7服务器端启动jupyter notebook服务,在windows端使用jupyter notebook,服务器充当后台计算云端
在CentOS7服务器端启动jupyter notebook服务,在windows端使用jupyter notebook,服务器充当后台计算云端 在服务器端启动jupyter notebook服务,在 ...
- linux安装python3 ,安装IPython ,安装jupyter notebook
安装python3 下载到 /opt/中 1.下载python3源码,选择3.6.7因为ipython依赖于>3.6的python环境wget https://www.python.org ...
- 初学者需要IPython 与 Jupyter Notebook 吗?
ipython 是 jupyter notebook的前身并拥有ipython的全部功能 jupyter拥有 cell, markdown 整合的功能, 能同时运行代码, 而且是多组的 ...
- 机器学习:Jupyter Notebook中numpy的使用
一.Jupyter Notebook的魔法命令 # 模块/方法 + ?或者help(模块/方法):查看模块/方法的解释文档: 1)%run # 机械学习中主要应用两个魔法命令:%run.%timeit ...
随机推荐
- MYSQL用户权限管理(Grant,Revoke)
MySQL可以为不同的用户分配严格的.复杂的权限.这些操作大多都可以用SQL指令Grant(分配权限)和Revoke(回收权限)来实现. Grant可以把指定的权限分配给特定的用户,如果这个用户不存在 ...
- Golang 并发concurrency
并发concurrency 很多人都是冲着Go大肆宣扬的高并发而忍不住跃跃欲试,但其实从源码解析来看,goroutine只是由官方实现的超级"线程池"而已.不过话说回来,每个实例4 ...
- JavaEE----登陆界面验证码实现
主要使用后端验证,调用awt API ,会简单调用即可,绘图代码已封装到LoginVerifyUtils中. 界面展示: LoginVerifyUtils全部代码 import java.awt.Co ...
- JavaScript的3种继承方式
JavaScript的继承方式有多种,这里列举3种,分别是原型继承.类继承以及混合继承. 1.原型继承 优点:既继承了父类的模板,又继承了父类的原型对象: 缺点:不是子类实例传参,而是需要通过父类实例 ...
- php一些单选、复选框的默认选择方法(示例)
转载 http://www.php.cn/php-weizijiaocheng-360029.html 一. radio和checkbox及php select默认选择的实现代码 1.radio单选框 ...
- 比较全git的.ignore文件配置
# maven,gradle ignoretarget/_build/build/_site/.gradle*dependency-reduced-pom.xmltest.* # eclipse ig ...
- 深入理解java虚拟机---3垃圾回收机制GC
本文来源于翁舒航的博客,点击即可跳转原文观看!!!(被转载或者拷贝走的内容可能缺失图片.视频等原文的内容) 若网站将链接屏蔽,可直接拷贝原文链接到地址栏跳转观看,原文链接:https://www.cn ...
- Re0:从零学习node.js
起小项目 express xxx 镜像 npm install npm install npm start 创建自己的端口...
- 对vector等STL标准容器进行排序操作(转!)
西方有句谚语:不要重复发明轮子! STL几乎封装了所有的数据结构中的算法,从链表到队列,从向量到堆栈,对hash到二叉树,从搜索到排序,从增加到删除......可以说,如果你理解了STL,你会发现你已 ...
- UI-12组结对编程作业总结
UI-12组结对编程作业总结 源码Github地址 https://github.com/tilmto/TILMTO/tree/master/Arithmetic 作业摘要 本次结对编程作业分为以下两 ...