【亲测】jupyter notebook报错解决:不理解“open location”信息。 (-1708) Mac,jupyter不能自动打开浏览器...

本文主要是介绍【亲测】jupyter notebook报错解决:不理解“open location”信息。 (-1708) Mac,jupyter不能自动打开浏览器...,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

我一般不太关注App Store的升级提示,但是看见了就升级。这倒不是为了赶时髦,而是我知道不升级的话,系统漏洞可能会被攻击。

之前的macOS升级还都比较顺利。软件兼容性也都没啥问题。

今天不一样了。

升级到了10.12.5后,像往常一样执行:

Python
<span class="wp_keywordlink_affiliate"><a href="https://www.168seo.cn/tag/jupyter-notebook" title="View all posts in jupyter notebook" target="_blank">jupyter notebook</a></span>
1
2
jupyter notebook

结果突然报错,吓了我一跳:

Python
➜ LearnPythonNotebook git:(master) ✗ <span class="wp_keywordlink_affiliate"><a href="https://www.168seo.cn/tag/jupyter-notebook" title="View all posts in jupyter notebook" target="_blank">jupyter notebook</a></span> zsh: /usr/local/bin/jupyter: bad interpreter: /usr/local/opt/<span class="wp_keywordlink"><a href="http://www.168seo.cn/python" title="python">python</a></span>/bin/python2.7: no such file or directory [I 13:58:51.602 NotebookApp] Serving notebooks from local directory: /Users/smslit/Desktop/LearnPythonNotebook [I 13:58:51.602 NotebookApp] 0 active kernels [I 13:58:51.602 NotebookApp] The Jupyter Notebook is running at: http://localhost:8888/?token=f6ca93231d4791de0dd64749e7f2fd62a50e55fc01456716 [I 13:58:51.602 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation). [C 13:58:51.606 NotebookApp] Copy/paste this URL into your browser when you connect for the first time, to login with a token: http://localhost:8888/?token=f6ca93231d4791de0dd64749e7f2fd62a50e55fc01456716 0:97: execution error: “"http://localhost:8888/tree?token=50b06d86ad89e16f44b101656e1b3aec168231dd00b143a4"”不理解“open location”信息。 (-1708)0:97: <span class="hljs-keyword">execution</span> <span class="hljs-keyword">error</span>: “<span class="hljs-string">"http://localhost:8889/tree?token=760a6d28d716f1671f0cf72f82a3cd5db958743fa86112f4"</span>”不理解“open location”信息。 (-1708)
1
2
3
4
5
6
7
8
9
10
11
12
➜ LearnPythonNotebook git : ( master ) ✗ jupyter notebook
zsh : / usr / local / bin / jupyter : bad interpreter : / usr / local / opt / python / bin / python2 . 7 : no such file or directory
[ I 13 : 58 : 51.602 NotebookApp ] Serving notebooks from local directory : / Users / smslit / Desktop / LearnPythonNotebook
[ I 13 : 58 : 51.602 NotebookApp ] 0 active kernels
[ I 13 : 58 : 51.602 NotebookApp ] The Jupyter Notebook is running at : http : / / localhost : 8888 / ? token = f6ca93231d4791de0dd64749e7f2fd62a50e55fc01456716
[ I 13 : 58 : 51.602 NotebookApp ] Use Control - C to stop this server and shut down all kernels ( twice to skip confirmation ) .
[ C 13 : 58 : 51.606 NotebookApp ]
Copy / paste this URL into your browser when you connect for the first time ,
to login with a token :
http : / / localhost : 8888 / ? token = f6ca93231d4791de0dd64749e7f2fd62a50e55fc01456716
0 : 97 : execution error : “ "http://localhost:8888/tree?token=50b06d86ad89e16f44b101656e1b3aec168231dd00b143a4"”不理解“ open location”信息。 ( - 1708 ) 0 : 97 : < span class = "hljs-keyword" > execution < / span > < span class = "hljs-keyword" > error < / span > : “ < span class = "hljs-string" > "http://localhost:8889/tree?token=760a6d28d716f1671f0cf72f82a3cd5db958743fa86112f4" < / span >”不理解“ open location”信息。 ( - 1708 )

对我来说,Jupyter Notebook属于学习工作必需品。大意不得。

好在看了看信息,似乎服务已经在端口8888上面运行了。

只是平时执行上述命令,Chrome就能自动弹出来,开启笔记本列表。现在好像这一步出问题了。没关系,我就手动执行吧。在浏览器里面输入:

Python
[localhost:8888](http://localhost:8888)
1
2
[ localhost : 8888 ] ( http : / / localhost : 8888 )

结果,笔记却没能直接出来。

让我输入密码。我设过密码吗?尝试了各种组合,均告失败。

于是我上网查询资料。还好,综合各方观点,找到了解决办法。

我遭遇的是两个问题:

  1. jupyter近期更新了安全机制,默认需要输入密码才能使用;
  2. 浏览器无法自行开启,确实是因为macOS 10.12.5环境的问题。

解决方法很简单。

在Jupyter的配置目录

Python
~/.jupyter
1
2
~ / . jupyter

下面新建一个文件,名称是:

Python
jupyter_notebook_config.py
1
2
jupyter_notebook_config . py

在这个文件里面加入3行代码:

Python
c.NotebookApp.browser = u'Safari' c.NotebookApp.token = '' c.NotebookApp.password = ''
1
2
3
4
c . NotebookApp . browser = u 'Safari'
c . NotebookApp . token = ''
c . NotebookApp . password = ''

保存文件,重新执行:

Python
jupyter notebook
1
2
jupyter notebook

效果是这样的:

各路豪杰尝试过多种方法,可是目前只有Safari浏览器可以通过这种方式调用。Google Chrome可能还得等几天,看看根据macOS的新版本,Jupyter能否做出一些升级调整。




  • zeropython 微信公众号 5868037 QQ号 5868037@qq.com QQ邮箱

这篇关于【亲测】jupyter notebook报错解决:不理解“open location”信息。 (-1708) Mac,jupyter不能自动打开浏览器...的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/628371

相关文章

mybatis和mybatis-plus设置值为null不起作用问题及解决

《mybatis和mybatis-plus设置值为null不起作用问题及解决》Mybatis-Plus的FieldStrategy主要用于控制新增、更新和查询时对空值的处理策略,通过配置不同的策略类型... 目录MyBATis-plusFieldStrategy作用FieldStrategy类型每种策略的作

Python如何实现PDF隐私信息检测

《Python如何实现PDF隐私信息检测》随着越来越多的个人信息以电子形式存储和传输,确保这些信息的安全至关重要,本文将介绍如何使用Python检测PDF文件中的隐私信息,需要的可以参考下... 目录项目背景技术栈代码解析功能说明运行结php果在当今,数据隐私保护变得尤为重要。随着越来越多的个人信息以电子形

Python Jupyter Notebook导包报错问题及解决

《PythonJupyterNotebook导包报错问题及解决》在conda环境中安装包后,JupyterNotebook导入时出现ImportError,可能是由于包版本不对应或版本太高,解决方... 目录问题解决方法重新安装Jupyter NoteBook 更改Kernel总结问题在conda上安装了

Goland debug失效详细解决步骤(合集)

《Golanddebug失效详细解决步骤(合集)》今天用Goland开发时,打断点,以debug方式运行,发现程序并没有断住,程序跳过了断点,直接运行结束,网上搜寻了大量文章,最后得以解决,特此在这... 目录Bug:Goland debug失效详细解决步骤【合集】情况一:Go或Goland架构不对情况二:

解决jupyterLab打开后出现Config option `template_path`not recognized by `ExporterCollapsibleHeadings`问题

《解决jupyterLab打开后出现Configoption`template_path`notrecognizedby`ExporterCollapsibleHeadings`问题》在Ju... 目录jupyterLab打开后出现“templandroidate_path”相关问题这是 tensorflo

如何解决Pycharm编辑内容时有光标的问题

《如何解决Pycharm编辑内容时有光标的问题》文章介绍了如何在PyCharm中配置VimEmulator插件,包括检查插件是否已安装、下载插件以及安装IdeaVim插件的步骤... 目录Pycharm编辑内容时有光标1.如果Vim Emulator前面有对勾2.www.chinasem.cn如果tools工

Python安装时常见报错以及解决方案

《Python安装时常见报错以及解决方案》:本文主要介绍在安装Python、配置环境变量、使用pip以及运行Python脚本时常见的错误及其解决方案,文中介绍的非常详细,需要的朋友可以参考下... 目录一、安装 python 时常见报错及解决方案(一)安装包下载失败(二)权限不足二、配置环境变量时常见报错及

Java多线程父线程向子线程传值问题及解决

《Java多线程父线程向子线程传值问题及解决》文章总结了5种解决父子之间数据传递困扰的解决方案,包括ThreadLocal+TaskDecorator、UserUtils、CustomTaskDeco... 目录1 背景2 ThreadLocal+TaskDecorator3 RequestContextH

解决JavaWeb-file.isDirectory()遇到的坑问题

《解决JavaWeb-file.isDirectory()遇到的坑问题》JavaWeb开发中,使用`file.isDirectory()`判断路径是否为文件夹时,需要特别注意:该方法只能判断已存在的文... 目录Jahttp://www.chinasem.cnvaWeb-file.isDirectory()遇

nginx部署https网站的实现步骤(亲测)

《nginx部署https网站的实现步骤(亲测)》本文详细介绍了使用Nginx在保持与http服务兼容的情况下部署HTTPS,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值... 目录步骤 1:安装 Nginx步骤 2:获取 SSL 证书步骤 3:手动配置 Nginx步骤 4:测