自上次发布了文章后有些网友就说不能实现效果,根据自己的实验发现确实有此事,那是因为版本的变化问题。这次基于yum仓库里的jupyter notebook 5.0.0版本实现;

系统:最小化安装[习惯性]

关闭防火墙:

  1. systemctl stop firewalld && systemctl disable firewalld

禁用SELINUX:

  1. [root@jupyter ~]# sed -i 's#SELINUX=enforcing#SELINUX=disabled#g' /etc/selinux/config
  2. [root@jupyter ~]# setenforce 0

添加EPLE源:

  1. rpm -ivh http://mirrors.yun-idc.com/epel/epel-release-latest-7.noarch.rpm

安装部分可能用到的依赖包:

  1. yum install vim openssl-devel readline-devel python-devel python-pip -y
 Python-3.5.2 编译安装:
  1. tar xf Python-3.5.2.tgz
  2. cd Python-3.5.2
  3. ./configure --prefix=/usr/local/python-3.5.2
  4. make && make install
  5. #创建一个软连接:
  6. ln -sf /usr/local/python-3.5.2/bin/python3 /usr/bin/python3
  7. ln -sf /usr/local/python-3.5.2/bin/pip3 /usr/bin/pip3
这样就安装完Python3了;
 
#接下来安装jupyter:
  1. pip install jupyter   //这命令默认使用的是Python2.7.5版本安装;

安装完后即可以启动:jupyter-notebook

  1. jupyter-notebook

如果在启动的时候提示,说明默认不建议使用root来运行,不过我们可以配置文件修改,接下来会介绍如何修改;

  1. [C 15:03:06.778 NotebookApp] Running as root is not recommended. Use --allow-root to bypass.
 在上一次的版本中直接执行jupyter notebook --generate-config即可初始化配置文件来,但是新版的要加入--allow-root才行;
  1. [root@pydev ~]# jupyter notebook --generate-config --allow-root
  2. Writing default config to: /root/.jupyter/jupyter_notebook_config.py
 

创建一个密码:[这样就不用每次复制URL地址]

  1. [root@jupyter ~]# ipython
  2. Python 2.7.5 (default, Nov  6 2016, 00:28:07)
  3. Type "copyright", "credits" or "license" for more information.
  4. IPython 5.3.0 -- An enhanced Interactive Python.
  5. ?         -> Introduction and overview of IPython's features.
  6. %quickref -> Quick reference.
  7. help      -> Python's own help system.
  8. object?   -> Details about 'object', use 'object??' for extra details.
  9. In [1]: from notebook.auth import passwd
  10. In [2]: passwd()
  11. Enter password:
  12. Verify password:
  13. Out[2]: 'sha1:da874cad4309:4104089e5ef97c8fcbe69c2ac7d6a1071ca50a40'
 
 修改配置文件中的IP地址、工作目录、并添加一个认证密码:
  1. 62 #c.NotebookApp.allow_root = False
  2. 去掉62行的注释,并修改成True即可解决root权限运行的问题。
  3. 163 #c.NotebookApp.ip = 'localhost'
  4. 去掉注释,并把localhost改成0.0.0.0,这样就可以外部访问了,默认只有在本机可以访问的;
  5. 163 c.NotebookApp.ip = '0.0.0.0'
  6. 203 #c.NotebookApp.notebook_dir = u''
  7. 改成如下,这样就会默认把notebook上创建的文件保存到指定目录下;需要事先创建。
  8. 203 c.NotebookApp.notebook_dir = u'/opt/jupyter'
  9. 218 #c.NotebookApp.password = u''
  10. 加入上面创建的密码:
  11. 218 c.NotebookApp.password = u'sha1:da874cad4309:4104089e5ef97c8fcbe69c2ac7d6a1071ca50a40'
 
这里就是行号有所变化;根据关键字查询即可;

保存,重新运行程序:

  1. [root@jupyter~]# jupyter-notebook
  2. [I 15:20:53.313 NotebookApp] Serving notebooks from local directory: /opt/jupyter
  3. [I 15:20:53.313 NotebookApp] 0 active kernels
  4. [I 15:20:53.313 NotebookApp] The Jupyter Notebook is running at: http://0.0.0.0:8888/
  5. [I 15:20:53.313 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
  6. [W 15:20:53.313 NotebookApp] No web browser found: could not locate runnable browser.

URL地址:10.0.10.253:8888

密码:123456

不过在查看版本的时候还是有个问题,就是切换了python版后,使用命令还是一样显示为python2.7.5

验证:输入命令:netstat -ntlp

[root@localhost centos]$  netstat -ntlp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN 1/systemd
tcp 0 0 192.168.122.1:53 0.0.0.0:* LISTEN 1980/dnsmasq
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1598/sshd
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN 1601/cupsd
tcp 0 0 0.0.0.0:8888 0.0.0.0:* LISTEN 18997/python
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 1874/master
tcp6 0 0 :::111 :::* LISTEN 1/systemd
tcp6 0 0 :::22 :::* LISTEN 1598/sshd
tcp6 0 0 ::1:631 :::* LISTEN 1601/cupsd
tcp6 0 0 :::8888 :::* LISTEN 18997/python
tcp6 0 0 ::1:25 :::* LISTEN 1874/master

centos6.4安装 jupyter-notebook的更多相关文章

  1. Docker 安装jupyter notebook

    1. 利用image运行一个container sudo docker run -it --net=host tingting --net=host:让container可以上网,安装原来的sudo ...

  2. linux安装python3 ,安装IPython ,安装jupyter notebook

    安装python3    下载到 /opt/中 1.下载python3源码,选择3.6.7因为ipython依赖于>3.6的python环境wget https://www.python.org ...

  3. ubuntu14.04安装jupyter notebook

    1.使用pip安装Jupyter notebook: pip install jupyter notebook 2.创建Jupyter默认配置文件: jupyter notebook --genera ...

  4. windows安装Jupyter Notebook

    这是我自定义的Python 的安装目录 (D:\SoftWare\Python\Python36\Scripts) 1.Jupyter Notebook 和 pip 为了更加方便地写 Python 代 ...

  5. Python---virtualenv + Tensorflow + 安装jupyter notebook

    一.ubuntu系统下安装完caffe后,安装 jupyter notebook. 在终端中执行,安装指令: sudo pip install jupyter 安装完成后运行 notebook : j ...

  6. python如何安装Jupyter notebook

    一,安装Jupyter notebook 环境:win10,python3.7 两种安装方式,这里只讲pip安装 pip install jupyter notebook 二,启动Jupyter no ...

  7. 环境配置 | 安装Jupyter Notebook及jupyter_contrib_nbextensions库实现代码自动补全

    一.Jupyter Notebook的安装与启动 安装Jupyter Notebook pip3 install jupyter 启动 jupyter notebook 输入命令后会自动弹出浏览器窗口 ...

  8. Centos7安装jupyter notebook

    安装python3 查看当前python版本 [root@iz1i4qd6oynml0z /]# python -V Python 2.7.5 安装python3以及检查python3的版本 yum ...

  9. Ubuntu安装Jupyter Notebook

    一.Jupyter介绍 Jupyter Notebook是一个交互式笔记本,支持运行40多种编程语言.Jupyter Notebook 的本质是一个 Web 应用程序,便于创建和共享文学化程序文档,支 ...

  10. 安装Conda并在Conda下安装jupyter notebook

    1:安装 conda install jupyter notebook 2:启动 jupyter notebook

随机推荐

  1. Kafka设计解析(二):Kafka High Availability (上)

    转自:http://www.infoq.com/cn/articles/kafka-analysis-part-2/ Kafka在0.8以前的版本中,并不提供High Availablity机制,一旦 ...

  2. 命令行模式启动VMWare虚拟机

    工作中使用到在centos中安装vmware Workstation部署虚拟机,以前都是使用图形界面启动虚拟机,由此要调整VNC的分辨率大小,重启VNC Server后所有虚拟机都关闭了.事后分析可能 ...

  3. 自然语言交流系统 phxnet团队 创新实训 个人博客 (三)

    因为需要处理自然语言的括号切分问题,专门记录下. import java.util.Scanner; import java.util.Stack; /** * @author Owner * */ ...

  4. USB学习笔记连载(七):CY7C68013A 无法识别的可能原因

    最近一直在调试视频 采集卡,和PC端连接的是USB接口,使用的是cypress的CY7C68013A-56PVXC. //======================================= ...

  5. 关于Unity中的声音管理模块(专题七)

    声音的要素 1: 音频文件AudioClip2: 音源AudioSource;3: 耳朵AudioListener;//全局只能有一个4: 2D/3D音频;//2D只是简单地播放声音,3D可以根据距离 ...

  6. 第三百四十节,Python分布式爬虫打造搜索引擎Scrapy精讲—css选择器

    第三百四十节,Python分布式爬虫打造搜索引擎Scrapy精讲—css选择器 css选择器 1. 2. 3.  ::attr()获取元素属性,css选择器 ::text获取标签文本 举例: extr ...

  7. Lucene系列四:Lucene提供的分词器、IKAnalyze中文分词器集成、扩展 IKAnalyzer的停用词和新词

    一.Lucene提供的分词器StandardAnalyzer和SmartChineseAnalyzer 1.新建一个测试Lucene提供的分词器的maven项目LuceneAnalyzer 2. 在p ...

  8. e559. 创建窗口

    A frame is a component container that displays its contents in a top-level window with a title bar a ...

  9. Lua------------------unity与lua的热更新

    [Unity3D]Unity3D游戏开发之Lua与游戏的不解之缘终结篇:UniLua热更新完全解读 标签: 游戏开发游戏解决方案用户体验unity3d 2014-10-18 23:23 7680人阅读 ...

  10. Linux——curl(转)

    先介绍curl工具的使用,在其他文章中介绍如何使用curl发送Identity API linux curl是一个利用URL规则在命令行下工作的文件传输工具.它支持文件的上传和下载,所以是综合传输工具 ...