Jupyter 安装 for-Mac

安装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
会显示一个输入密码的界面。(当然,你并没有设置密码)

Paste_Image.png

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,重新打开网页即可

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • Spring Cloud为开发人员提供了快速构建分布式系统中一些常见模式的工具(例如配置管理,服务发现,断路器,智...
    卡卡罗2017阅读 135,324评论 19 139
  • 为什么用 Jupyter 2 个同事的推荐:一个刷了许多 MOOC 包括数据科学课的学霸直接推荐给我;另一个录制数...
    苏尚君阅读 12,559评论 1 2
  • 首先是要 安装 Anaconda 。 默认情况下,安装好 Anaconda 后打开 jupyter noteboo...
    liuchengxu阅读 31,835评论 4 14
  • Tensorflow超参数的选择 从上个例子里,我们写死了learning rate 以及 batch-size,...
    __Adan__阅读 5,900评论 0 2
  • 最近在时间管理群里推荐大家看了关于时间管理和整理的电影和电视,今天正好聊到《我的家里空无一物》,妈妈们感概比较深,...
    橙汁妈妈阅读 1,625评论 0 0