[转]Linux中python3.6+ipython+Jupyter Notebook环境
python3.6安装
- 下载python安装包,这里下载的最新的3.6.1版本
https://www.python.org/ftp/python/3.6.1/ - 将安装包上传到服务器并解压
tar zxvf Python-3.6.1.tgz
- 安装python
cd Python-3.6.1
./configure --prefix=/usr/local/python-3.6.1 #重要,指定python的安装路径,可以自己设置。
make
sudo make install
- 修改python的软链接 (建立软链接,变为全局)
sudo ln -s /usr/local/python-3.6.1/bin/python3.6 /usr/bin/python
- 查看python版本,发现已经改变
python
ipython安装
- 下载ipython,并上传到服务器
http://archive.ipython.org/release/6.0.0/ - 解压
tar -zxvf ipython-6.0.0.tar.gz
- 进入解压的ipython目录并执行如下命令进行安装
python setup.py install
- 进行链接
ln -s /usr/local/python-3.6.1/bin/ipython /usr/sbin/ipython
- 检查ipython是否安装成功
ipython

此时发现提示说有模板缺失,使用pip进行安装。
pip install traitlets
再执行ipython进行检验,发现还是某个模板缺失

继续用pip进行安装,知道执行ipython时出现如下界面,代表安装成功。

Jupyter Notebook安装
Jupyter Notebook(此前被称为 IPython notebook)是一个交互式笔记本,支持运行 40 多种编程语言。Notebook是一个数据分析和编写代码的好工具。它的核心在于展示与快速迭代。
摘自:知乎为什么使用jupyter?
看完知乎的这个回答会对jupyter有个大概的认知,接下来进行安装。
- 安装jupyter notebook
pip install jupyter notebook
- 启动notebook
jupyter notebook
此时报错,不建议用root运行启动命令:
[I 16:23:40.195 NotebookApp] Writing notebook server cookie secret to /root/.local/t
[C 16:23:40.213 NotebookApp] Running as root is not recommended. Use --allow-root t.
解决方法:
- 修改配置文件,执行jupyter notebook --generate-config即可初始化配置文件来,但是这里要加入--allow-root才行
[root@localhost ~]# jupyter notebook --generate-config --allow-root
Writing default config to: /root/.jupyter/jupyter_notebook_config.py
- 创建一个密码:[这样就不用每次复制URL地址]
[root@localhost ~]# ipython
Python 3.6.1 (default, May 25 2017, 16:49:43)
Type 'copyright', 'credits' or 'license' for more information
IPython 6.0.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:f6ac161e9215:dc0eb8c8d43b74e32bb03db161e3261ea5d7c297'
将这里的 ```
'sha1:f6ac161e9215:dc0eb8c8d43b74e32bb03db161e3261ea5d7c297'
* 修改配置文件中的IP地址、工作目录、并添加一个认证密码:
[root@localhost .jupyter]# vim /root/.jupyter/jupyter_notebook_config.py
修改权限
c.NotebookApp.allow_root = False
去掉行注释,并修改成True即可解决root权限运行的问题。
设置,外部可访问
c.NotebookApp.ip = 'localhost'
去掉注释,并把localhost改成0.0.0.0,这样就可以外部访问了,默认只有在本机可以访问的;
c.NotebookApp.ip = '0.0.0.0'
设置notebook的工作目录
c.NotebookApp.notebook_dir = u''
改成如下,这样就会默认把notebook上创建的文件保存到指定目录下;需要事先创建。
c.NotebookApp.notebook_dir = u'/opt/jupyter'
加入密码
c.NotebookApp.password = u''
加入上面创建的密码:
c.NotebookApp.password = u'sha1:f6ac161e9215:dc0eb8c8d43b74e32bb03db161e3261ea5d7c297'
3. 进入notebook界面
再次执行启动命令,出现如下信息,表示成功
[root@localhost .jupyter]# jupyter-notebook
[I 18:09:58.194 NotebookApp] Serving notebooks from local directory: /opt/jupyter
[I 18:09:58.194 NotebookApp] 0 active kernels
[I 18:09:58.194 NotebookApp] The Jupyter Notebook is running at:
http://0.0.0.0:8888/bookApp]
在浏览器输入如下网址:http://你的ip:8888
可以看到如下界面:

**参考:**
[官方文档](https://jupyter.readthedocs.io/en/latest/install.html)
[centos7安装notebook 5.0.0的方法](https://www.58jb.com/html/146.html)
作者:夏无忧阳
链接:https://www.jianshu.com/p/0133f79a12db
来源:简书
简书著作权归作者所有,任何形式的转载都请联系作者获得授权并注明出处。
vim /etc/systemd/system/shadowsocks.service
systemctl daemon-reload
systemctl status shadowsocks -l
systemctl start shadowsocks
[转]Linux中python3.6+ipython+Jupyter Notebook环境的更多相关文章
- 如何在Python中快速画图——使用Jupyter notebook的魔法函数(magic function)matplotlib inline
如何在Python中快速画图--使用Jupyter notebook的魔法函数(magic function)matplotlib inline 先展示一段相关的代码: #we test the ac ...
- Linux中python3,django,redis以及mariab的安装
1. Linux中python3,django,redis以及mariab的安装 2. CentOS下编译安装python3 编译安装python3.6的步骤 1.下载python3源码包 wget ...
- Jupyter Notebook环境安装
Jupyter Notebook环境安装 一.什么是jupyter Notebook 1.简介 Jupyter Notebook 是基于网页的用于交互计算机的应用程序器可被应用程序. 能让用户将说明文 ...
- linux安装python3 ,安装IPython ,安装jupyter notebook
安装python3 下载到 /opt/中 1.下载python3源码,选择3.6.7因为ipython依赖于>3.6的python环境wget https://www.python.org ...
- linux中python3安装和使用
python安装 下载python安装包和依赖环境 #自由选择python3源码包的版本https://www.python.org/ftp/python/https://www.python.org ...
- 本地主机访问远程linux系统服务器上的jupyter notebook
1,机器情况:服务器 centos python环境已经配置好了,在虚拟环境下安装了anaconda 并且在里面安装了jupyter notebook 2,主机是 windows ipytho ...
- Ubuntu16.04部署python2和python3共存的Jupyter Notebook
一.安装python和python-pip sudo apt-get install python python3 python-pip python3-pip sudo pip install -- ...
- 【机器学习 Azure Machine Learning】使用Aure虚拟机搭建Jupyter notebook环境,为Machine Learning做准备(Ubuntu 18.04,Linux)
问题描述 在Azure的VM中已经安装好Jupyter,并且通过jupyter notebook --port 9999 已经启动,但是通过本机浏览器,访问VM的公网IP,则始终是不能访问的错误.(T ...
- [python之ipython] jupyter notebook在云端服务器上开启,本地访问
本地ssh到云端: ssh username@xxx.xxx.xxx.xxx -L127.0.0.1:7777:127.0.0.1:8888 把云端的8888端口映射到本地的7777端口 云端运行指令 ...
随机推荐
- Node.js 串口通讯 node-serialport 使用说明
官网:https://serialport.io/en/ 安装:npm install serialport Parsers说明:parser-byte-length:大概意思是定义了一个长度为len ...
- H5页面访问java后台进行登录拦截
1.未登录状态下进行拦截,回到登录页面 function judgeLogin(currentPage) { var judge=false; var storage=window.localStor ...
- jquery slideDown 控制div出现的方向
.custom-popup { position: absolute; /*top: 0;*/ 上向下 ; 下向上 ; ; display: none; width: 100%; height: 10 ...
- 简单透析cookies,sessionStorage和localStorage
首先大致说一下 1.sessionStorage是会话层的一种存储方式,当会话关闭或者退出,sessionStorage就会被清除,有效期较短 2.localStorage是浏览器提供的本地存储方式, ...
- 排序总结(java)
public class sort { public static void main(String[] args) { int[] arr = {2, 5, 3, 4, 8, 5, 1}; //so ...
- swift4.0 数据转模型
swift 4.0时代的到来,说明了swift已经趋于稳定了,已经完全可以入坑了. 下面就拿最简单的数据转模型来说说,实战一下. 接口使用: http://116.211.167.106/api/l ...
- homer进行motif分析 ChIP-seq
http://homer.salk.edu/homer/ [怪毛匠子-整理] 使用HOMER分析CLIP-SEQ数据 24 5 2月 2013 | 程序员 Tags: 生物信息学 · 软件 HOM ...
- 【EMV L2】终端验证结果(Terminal Verification Results,TVR)
终端验证结果,Terminal Verification Results(TVR),Tag95,5bytes: 记录交易过程中,数据认证.处理限制.持卡人验证.终端风险管理.行为分析以及联机处理的结果 ...
- [ 随手记 4 ]C/C++ 模板(Template)使用/重载区别
(原创)个人理解: 模板,故名思义,就是一个模子: 模板分为:类模板和函数模板(也可叫模板类和模板函数): 模板特点:(1)函数名字一样: (2)调用的形参的数据类型不同,但形参个数相同: (3)函数 ...
- vue.js 精学组件记录
组件需要注册后才可以使用. Vue.component('my-component',{ template:'<div>这是组件内容</div>' }): 局部注册组件 var ...
