在pycharm中使用jupyter笔记本-没有这样的笔记本目录

cb4*_*cb4 6 pycharm jupyter-notebook

我正在尝试使用PyCharm 2016.1中的jupyter笔记本。我打开一个先前创建的iPython笔记本,单击包含代码的单元格,然后运行它。我被提示在默认URL下启动jupyter notebook,然后单击“确定”。以下是“运行”窗口中的错误消息:

[C 13:04:23.979 NotebookApp] Bad config encountered during initialization:
The Jupyter HTML Notebook.
[C 13:04:23.979 NotebookApp] No such notebook dir: 'C:\\Users\\cb4\\Documents\\python'
Run Code Online (Sandbox Code Playgroud)

使用默认网址在PyCharm中启用了iPython Notebook。

cb4*_*cb4 6

Jupyter将配置信息保留在jupyter_notebook_config.py文件中。您可以C:\Users\<user>\.jupyter在Windows或~\.jupyterLinux 上找到它。将该c.NotebookApp.notebook_dir条目修改为您存放笔记本的位置。您也可以使用命令行进行设置:

jupyter-notebook --notebook-dir=<path>
Run Code Online (Sandbox Code Playgroud)

如果<path>路径名中有空格,请在Windows上用双引号引起来。

如果在升级到jupyter之前安装了iPython,则jupyter迁移过程将使用旧iPython配置文件中的设置。自修改iPython以来可能已经很长时间了,这就是为什么您从jupyter看到意外的启动或运行行为的原因。

另外,此jupyter命令可能有助于解决目录/路径问题:

jupyter --paths
Run Code Online (Sandbox Code Playgroud)


小智 5

遇到了同样的问题,并使用以下命令解决了该问题:

jupyter notebook --generate-config
Run Code Online (Sandbox Code Playgroud)

更多信息在这里:http : //jupyter-notebook.readthedocs.io/en/stable/config.html

它提示我将当前配置替换为默认配置。因此,如果您可以摆脱当前的配置,这是一个简单的选择。