pycharm 安装Jupyter Notebook

Jupyter Notebook(此前被称为 IPython notebook)是一个交互式笔记本,支持运行 40 多种编程语言。在本文中,我们将介绍 Jupyter notebook 的主要特性,以及为什么对于希望编写漂亮的交互式文档的人来说是一个强大工具。

在开始使用 notebook 之前,我们先需要安装该库。你可以在 Jupyter 官网上找到完整的步骤。

译者注:其实只要pip install jupyter就可以了

jupyter notebook

运行上面的命令之后,你将看到类似下面这样的输出:

[I 20:06:36.367 NotebookApp] Writing notebook server cookie secret to /run/user/1000/jupyter/notebook_cookie_secret
[I 20:06:36.813 NotebookApp] Serving notebooks from local directory: /home/your_username
[I 20:06:36.813 NotebookApp] 0 active kernels
[I 20:06:36.813 NotebookApp] The IPython Notebook is running at: http://localhost:8888/
[I 20:06:36.813 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).

Running as root is not recommended. Use --allow-root to bypass

首先输入,查看配置文件位置

[as-pc as]# jupyter notebook --generate-config --allow-root 

Overwrite /root/.jupyter/jupyter_notebook_config.py with default config? [y/N]y
Writing default config to: /root/.jupyter/jupyter_notebook_config.py

接下来打开配置文件

gedit /root/.jupyter/jupyter_notebook_config.py
1
找到这一行

#c.NotebookApp.allow_root = False  

去掉#,并修改成True即可解决root权限运行的问题

c.NotebookApp.allow_root =True

保存,重新运行程序

jupyter notebook

设置访问密码 
打开 ipython 输入

from notebook.auth import passwd
passwd()

然后根据提示输入2次密码 
Enter password: ········ 
Verify password: ········ 
 

然后复制 ‘sha1:f5643****************************’ 粘贴至配置文件(记得去掉 #

 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值