在pycharm中使用jupyter笔记本-没有这样的笔记本目录 [英] using jupyter notebook in pycharm - no such notebook dir
问题描述
我正在尝试使用PyCharm 2016.1中的jupyter笔记本.我打开一个先前创建的iPython笔记本,单击包含代码的单元格,然后运行它.我被提示在默认URL上启动jupyter笔记本,然后单击确定".这是运行"窗口中的错误消息:
I'm trying to use jupyter notebook from PyCharm 2016.1. I open a previously created iPython notebook, click in a cell with code, and run it. I get prompted to start jupyter notebook at the default url and click OK. Here are the error messages from the Run window:
[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'
在PyCharm中使用默认网址启用了iPython Notebook.
iPython Notebook is enabled in PyCharm with the default url.
推荐答案
Jupyter将配置信息保留在jupyter_notebook_config.py
文件中.您可以在Windows的C:\Users\<user>\.jupyter
或Linux的~\.jupyter
中找到它.将c.NotebookApp.notebook_dir
条目修改为您存放笔记本的位置.您也可以使用命令行进行设置:
Jupyter keeps configuration info in the jupyter_notebook_config.py
file. You can find it in C:\Users\<user>\.jupyter
on Windows or ~\.jupyter
on linux. Modify the c.NotebookApp.notebook_dir
entry to the location where you keep your notebooks. You can also use the command line to set it:
jupyter-notebook --notebook-dir=<path>
如果路径名中有空格,请在Windows上将<path>
用双引号引起来.
Enclose the <path>
in double quotes on Windows if there is a space in the path name.
如果在升级到jupyter之前安装了iPython,则 jupyter迁移进程使用了旧iPython配置文件中的设置.自从您修改iPython以来可能已经很长时间了,这就是为什么您从jupyter看到意外的启动或运行行为的原因.
If you had iPython installed before upgrading to jupyter, then the jupyter migration process used the settings from your old iPython config file. Maybe it's been a long time since you modified iPython and that is why you are seeing unexpected startup or running behavior from jupyter.
此外,此jupyter命令还可以帮助解决目录/路径问题:
Also, this jupyter command may help troubleshoot directory/path problems:
jupyter --paths
这篇关于在pycharm中使用jupyter笔记本-没有这样的笔记本目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!