码迷,mamicode.com
首页 > 编程语言 > 详细

IPython notebook详细安装教程

时间:2016-06-21 10:30:09      阅读:1672      评论:0      收藏:0      [点我收藏+]

标签:

IPython从4.0开始,为了项目的独立运行,便将notebook等一系列附加组件迁移至jupyter中,从而使得IPython专注于交互式python这一功能。让我们来看看官网上的解释:

“IPython is a growing project, with increasingly language-agnostic components. IPython 3.x was the last monolithic release of IPython, containing the notebook server, qtconsole, etc. As of IPython 4.0, the language-agnostic parts of the project: the notebook format, message protocol, qtconsole, notebook web application, etc. have moved to new projects under the name Jupyter. IPython itself is focused on interactive Python, part of which is providing a Python kernel for Jupyter.”

从以上的解释中我们就可以了解到,IPython从此独立,与Jupyter成为并行发展的两个项目。本文主要介绍Ipython与Jupyter在ubuntu上的安装过程,如果是采用Ipython 3.x之前的版本,安装过程则只需要简单的几条命令即可,并不会遇到任何问题。

方法一:Anoconda

按照官网的方法,安装Anoconda集成包,那么所有需要的工具都不需要另外安装,比如python,ipython,jupyter。具体方法参照Anoconda安装方法,这里不再具体介绍。

方法二:独立安装python+ipython+jupyter

sudo apt-get install python
pip install ipython pip install jupyter

注意,如果使用的是python3,则将pip改为pip3.

安装完成之后,在终端输入

jupyter notebook

不建议使用sudo或ipython notebook命令。

遇到的问题:

打开之后,此时如果新建notebook或者打开现有的ipynb文件,都会遇到问题。在打开ipynb文件的时候,会提示

An unknown error occurred while loading this notebook. This version can load notebook formats v4 or earlier. See the server log for details.

终端则会有相应的错误信息

Unhandled error in API request
...
...
OperationalError: unable to open database file

通过总结网友的各种方案,现提供两种有效的解决方法:

1. 找到nbsignatures.db文件并将其删除,该文件一般位于~/.local/share/jupyter文件夹内。

2. 修改~/.local/share/jupyter文件夹的权限。

至于为什么会出现这个问题,可能是由于jupyter中隐含有bug,希望后续版本可以解决这个问题。

IPython notebook详细安装教程

标签:

原文地址:http://www.cnblogs.com/lindsay1991/p/5602583.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!