安装Jupyter
我的环境:
python3.6 macos
安装过程:
1、在终端内直接输入 pip3 install jupyter
2、安装好后,运行下面的命令
jupyter notebook
运行后,你将看到类似下面的输出:
[I 11:49:16.849 NotebookApp] Serving notebooks from local directory: /Users/home
[I 11:49:16.850 NotebookApp] 0 active kernels
[I 11:49:16.850 NotebookApp] The Jupyter Notebook is running at: http://localhost:8888/?token=9f09f19d1af8f69f690ffb33360039dc455678680205404a
[I 11:49:16.850 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 11:49:16.851 NotebookApp]
Copy/paste this URL into your browser when you connect for the first time,
to login with a token:
http://localhost:8888/?token=9f09f19d1af8f69f690ffb33360039dc455678680205404a
0:97: execution error: “"http://localhost:8888/tree?token=8bbf7771defd41ec75651943ae234ee217103d3045706c1a"”不理解“open location”信息。 (-1708)
3、在浏览器中打开http://127.0.0.1:8888/login?next=%2Ftree
会显示一个输入密码的界面。(当然,你并没有设置密码)
4、退回到终端,按Ctrl+c 退出jupyter服务器。在终端中输入下面的命令生成配置文件
upyter notebook --generate-config
记录下生成的配置文件位置,例如:/Users/home/.jupyter/jupyter_notebook_config.py
5、在终端中输入ipython3 打开Python,生成密码的sha1密钥,代码如下:
from notebook.auth import passwd
passwd()
在文本框中输入并确认一次密码后记录sha1秘钥值,如 'sha1:XXXXXXX'
exit() 退出python
6、在终端中进入jupyter文件夹,打开jupyter_notebook_config.py文件
cd /Users/home/.jupyter/
vi jupyter_notebook_config.py
将sha1秘钥值按如下格式粘贴到配置文件jupyter_notebook_config.py末尾
c.NotebookApp.password = u'sha1:XXXXXXX'
重启jupyter,重新打开网页即可
网友评论