【问题标题】:Execution error: Can't open jupyter notebook on command line (MacOS)执行错误:无法在命令行上打开 jupyter notebook (MacOS)
【发布时间】:2017-05-22 17:29:40
【问题描述】:

我是刚开始学习 Python 和其他计算机语言的新手。我在我的 Mac 和 anaconda 上安装了 Jupiter notebook,当我尝试用我的命令打开 jupyter notebook 时遇到了问题。

消息弹出为:

execution error: "~~~(I just abbreviated the location)" doesn’t understand the “open location” message. (-1708)

我不知道这里发生了什么。

我该如何解决这个问题?

【问题讨论】:

标签: python-2.7 anaconda jupyter-notebook


【解决方案1】:

此问题已在jupyter notebook github repo 中解决。

一种解决方案是设置您的浏览器,例如:

c.NotebookApp.browser = u'Safari'

在配置文件中:~/.jupyter/jupyter_notebook_config.py

【讨论】:

  • 如果文件不存在,您可以通过以下方式生成它:jupyter notebook --generate-config
【解决方案2】:

关于 SO 有一个类似的问题可以解决这个问题。有几个解决方法建议在那里避免这个问题:

Ipython notebook will not start on command line

此外,这也是一个已知问题,可能是由于最近升级了 Mac OSX。可以关注hereherehere的讨论。

【讨论】:

    【解决方案3】:

    我的解决方法是使用 Mac 的 automator 工具应用程序同时打开 Chrome 和 jupyter notebook。这是applescript:

    on run {input, parameters}
        tell application "Terminal"
            activate
            do script with command "jupyter notebook"
        end tell
        tell application "Google Chrome"
            activate
            open location "http://localhost:8888/"
        end tell
    
    end run
    

    希望这会有所帮助! 如果您过去没有使用过 Automator,这里有一个关于如何使用 Automator 的好网址:http://radarearth.com/content/automate-terminal-automator

    【讨论】:

      【解决方案4】:

      export BROWSER=/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome

      【讨论】:

        猜你喜欢
        • 2019-07-13
        • 1970-01-01
        • 1970-01-01
        • 2018-12-12
        • 2016-12-06
        • 2023-04-05
        • 2019-08-20
        • 2020-04-21
        相关资源
        最近更新 更多