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 ...
随机推荐
- curl 详解【转】
原文:https://blog.csdn.net/lansesl2008/article/details/14523303 用途说明 curl命令是一个功能强大的网络工具,它能够通过http.ftp等 ...
- Linux配置多个Tomcat同时运行
Linux系统下怎样配置多个Tomcat同时运行呢,首先修改变量为第一个tomcat,然后修改第二个tomcat启动的脚本 1.修改环境变量 # vi /etc/profile ####### 工程1 ...
- nginx权限问题failed(13:Permission denied)
nginx权限问题failed(13:Permission denied) 环境配置 nginx Permission denied 问题: 使用nginx代理uwsgi,出现500错误,查看ngi ...
- Android系统版本、Platform版本、SDK版本、gradle修改
虽然之前分析了gradle,但是在eclipse导入Android studio的时候,各个版本出现的问题还是很模糊,下面对各种版本进行一下说明: 参考资料: https://developer.an ...
- [leetcode]238. 除自身以外数组的乘积
题目描述 给定长度为 n 的整数数组 nums,其中 n > 1,返回输出数组 output ,其中 output[i] 等于 nums 中除 nums[i] 之外其余各元素的乘积. 示例: 输 ...
- Docker基础-端口映射与容器互联
1.端口映射实现访问容器 1.从外部访问容器应用 在启动容器的时候,如果不指定对应的参数,在容器外部是无法通过网络来访问容器内部的网络应用和服务的. 当容器中运行一些网络应用,要让外部访问这些应用时, ...
- 基于Spring Security2与 Ext 的权限管理设计与兑现
基于Spring Security2与 Ext 的权限管理设计与实现 一.Spring Security介绍 Spring Security的前身Acegi,其配置及使用相对来说复杂一些,因为要配置的 ...
- cloudera Manager使用总结
最近在用cloudera Manager来 在几个虚拟机上进行hadoop 的安装,总结一下遇到的问题. 1 似乎没有 start-balancer.sh 命令 似乎安装包中没有这个命令 怎么 ...
- 随机错乱排序(sort的应用)
新手上路,大家多多指教哈,,, #include <iostream> #include <algorithm> #include <ctime> using na ...
- Android - AssetManager
http://blog.csdn.net/luoshengyang/article/details/8791064