欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

尝试ipython 以及 jupyter notebook

程序员文章站 2022-05-25 20:58:10
...

尝试ipython 以及 jupyter notebook

/usr/bin/pip3 install ipython
/usr/bin/python3 install jupyter

#生成配置文件
jupyter notebook --generate-config

#生成密码
ipython
In [1]: from notebook.auth import passwd
In [2]: passwd()
Enter password: 
Verify password: 
Out[2]: 'argon2:$argon2id$v=19$m=10240,t=10,p=8$QPCeKK3oExFtYAKg/VfOYg$TyQ9ITnFpnB9Ofk+wmRLkQ'
#应该是一串sha1开头的hash字符
ipython
In [1]: from notebook.auth import passwd
In [2]: passwd(algorithm='sha1')
Enter password: 
Verify password:
Out[2]: 'sha1:e0a5a7781392:56068a4942cb32b44cad0897bf3aa32fcbc13193'

#修改默认配置文件
vim ~/.jupyter/jupyter_notebook_config.py

#修改内容如***意将注释符号删除
c.NotebookApp.ip='*'
c.NotebookApp.password = u'sha:ce...刚才复制的那个密文'
c.NotebookApp.open_browser = False
c.NotebookApp.port =8888 #随便指定一个端口
c.NotebookApp.allow_remote_access = True

#启动
jupyter notebook	#或者
ipython notebook
相关标签: python python