linux安装jupyter

1、下载jupyter

pip install ipython
pip install jupyter

如果安装时出现了如下的错误:

You are using pip version 18.1, however version 19.3.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

那就执行pip install --upgrade pip即可

2、配置

输入jupyter命令
在这里插入图片描述
如果出现途中的结果则继续进行配置,如果出现-bash: jupyter: command not found,则执行以下操作:

find -name jupyter

在这里插入图片描述

vim /etc/profile
export PATH=$PATH:/usr/local/python3/bin/ #添加此行代码至最后一行
source  /etc/profile
jupyter

出现步骤2中第一张图的结果则证明可以继续进行配置jupyter了

jupyter notebook --generate-config \--allow-root

执行成功后会出现:

Writing default config to: /root/.jupyter/jupyter_notebook_config.py

3、生成密码

从 jupyter notebook 5.0 版本开始,提供了一个命令来设置密码:jupyter notebook password,生成的密码存储在 jupyter_notebook_config.json。

jupyter notebook password

在这里插入图片描述
进入ipython

ipython
In [1]: from notebook.auth import passwd                                                                                                                                                                                                                                                                                                    

In [2]: passwd()                                                                                                                                                                                                                                                                                                                            
Enter password: 
Verify password: 
Out[2]: 'sha1:fa826555782f:b77fca515f6c7b28e0d7aa27e5a0e182dace7a96'
vim /root/.jupyter/jupyter_notebook_config.py  #此路径为步骤二最后的输出结果路径

在 jupyter_notebook_config.py 中找到下面的行,取消注释并修改

c.NotebookApp.ip='0.0.0.0'  
c.NotebookApp.password = 'sha1:fa826555782f:b77fca515f6c7b28e0d7aa27e5a0e182dace7a96'  
c.NotebookApp.open_browser = False
c.NotebookApp.port =8888 #访问时使用该端口
c.NotebookApp.notebook_dir  = '' #服务器存放文件的路径地址

保存后就可以对我们的jupyter启动了。

jupyter notebook # root 用户需要添加 --allow-root

jupyter notebook --generate-config --allow-root遇到的问题

在这里插入图片描述
错误信息很明显,没有sqlite3,楼主开始安装,

yum install sqlite*  #此处用*纯粹是为了方便

在这里插入图片描述
安装时又出现了为了,是因为楼主前边把系统的python版本进行了一次升级,修改了/usr/bin/yum文件中的第一行,/usr/libexec/urlgrabber-ext-down文件中的第一行需要和yum中的一样,所以需要将/usr/libexec/urlgrabber-ext-down中的第一行python的版本也进行修改和yum中一致,然后再次安装,成功!

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值