【发布时间】:2019-01-20 12:07:58
【问题描述】:
在 Windows 10 cmd.exe 中,我可以通过以下命令在当前目录中启动 jupyter:
jupyter notebook --notebook-dir="."
当前目录为C:\Users\Евгений\Documents\GitHub\sandbox
但是,当我在 jupyter 工作目录上方的当前目录中简单地启动 jupyter notebook 时,是 D:/git:
λ cd
C:\Users\Евгений\Documents\GitHub\sandbox
λ jupyter notebook
[I 14:46:44.273 NotebookApp] The port 8888 is already in use, trying another port.
[I 14:46:44.304 NotebookApp] JupyterLab beta preview extension loaded from D:\Anaconda3\lib\site-packages\jupyterlab
[I 14:46:44.304 NotebookApp] JupyterLab application directory is D:\Anaconda3\share\jupyter\lab
[I 14:46:44.571 NotebookApp] Serving notebooks from local directory: D:/git
注意最后一行Serving notebooks from local directory: D:/git。 D:/git 可能来自哪里?是否有环境变量other than these 影响工作目录选择?
- 我的
%USERPROFILE%/.jupyter完全是空的。 -
jupyter --config-dir指向C:\Users\Евгений\.jupyter,是%USERPROFILE%/.jupyter。
我阅读了有关 jupyter 调用的各种线程,特别是:
-
this large thread 建议
jupyter notebook在cmd.exe和 Anaconda 提示符下的行为会有所不同,但没有进一步的细节 - Problems with configuring Jupyter start directory 解决了 Windows 快捷方式的问题,类似于 Windows app start steps
-
this post 建议将
--notebook-dir="."密钥包装到 .bat 文件中
我的另一个想法是jupyter 无法识别具有非拉丁字符的%USERPROFILE%,但%USERPROFILE%/.jupyter 无论如何都是空的。
【问题讨论】:
标签: windows cmd jupyter-notebook jupyter