【发布时间】:2018-05-12 01:05:10
【问题描述】:
有一次我将我的 Jupyter 主目录设置为 ~/Dropbox 不幸的是,由于 Dropbox 更改其文件夹名称的方式,该位置现在是我机器上指向隐藏目录的符号链接。这会导致 Jupyter 出现以下错误
Refusing to serve hidden directory '/Users/alex/Dropbox', via 404 Error
很好......我现在想更改我的 Jupyter 主目录,但我遇到的问题是我无法弄清楚它当前的设置位置。
我已经检查了我的~/.jupyter/jupyter_notebook_config.py,但这似乎与默认设置没有任何关系。
$jupyter --paths 的输出是:
config:
/Users/alex/.jupyter
/usr/local/Cellar/python@2/2.7.14_3/Frameworks/Python.framework/Versions/2.7/etc/jupyter
/usr/local/etc/jupyter
/etc/jupyter
data:
/Users/alex/Library/Jupyter
/usr/local/Cellar/python@2/2.7.14_3/Frameworks/Python.framework/Versions/2.7/share/jupyter
/usr/local/share/jupyter
/usr/share/jupyter
runtime:
/Users/alex/Library/Jupyter/runtime
有趣的是,以下目录不存在。
/usr/local/Cellar/python@2/2.7.14_3/Frameworks/Python.framework/Versions/2.7/etc/jupyter
/usr/local/etc/jupyter
/etc/jupyter
在/Users/alex/.jupyter/jupyter_notebook_config.py 中设置c.NotebookApp.notebook_dir = '/Users/alex/' 似乎没有效果。
$jupyter notebook
[I 18:26:34.756 NotebookApp] [nb_conda_kernels] enabled, 4 kernels found
[I 18:26:35.257 NotebookApp] The port 8888 is already in use, trying another port.
[I 18:26:35.258 NotebookApp] The port 8889 is already in use, trying another port.
[I 18:26:35.259 NotebookApp] The port 8890 is already in use, trying another port.
[I 18:26:35.260 NotebookApp] The port 8891 is already in use, trying another port.
[I 18:26:36.299 NotebookApp] [nb_anacondacloud] enabled
[I 18:26:36.304 NotebookApp] [nb_conda] enabled
[I 18:26:36.382 NotebookApp] ✓ nbpresent HTML export ENABLED
[W 18:26:36.382 NotebookApp] ✗ nbpresent PDF export DISABLED: No module named 'nbbrowserpdf'
[I 18:26:36.388 NotebookApp] Serving notebooks from local directory: /Users/alex
[I 18:26:36.388 NotebookApp] 0 active kernels
[I 18:26:36.388 NotebookApp] The Jupyter Notebook is running at:
[I 18:26:36.388 NotebookApp] http://localhost:8892/?token=289948463daed06187325be63202f620b812dddc14f2918a
[I 18:26:36.388 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 18:26:36.389 NotebookApp]
Copy/paste this URL into your browser when you connect for the first time,
to login with a token:
http://localhost:8892/?token=289948463daed06187325be63202f620b812dddc14f2918a
[I 18:26:36.717 NotebookApp] Accepting one-time-token-authenticated connection from ::1
[I 18:26:37.252 NotebookApp] Refusing to serve hidden directory '/Users/alex/Dropbox', via 404 Error
[W 18:26:37.252 NotebookApp] 404 GET /api/contents?type=directory&_=1526088397023 (::1): directory does not exist: 'Dropbox'
[W 18:26:37.252 NotebookApp] directory does not exist: 'Dropbox'
[W 18:26:37.253 NotebookApp] 404 GET /api/contents?type=directory&_=1526088397023 (::1) 15.70ms referer=http://localhost:8892/tree
可以从哪里设置 Jupyter 主目录?
【问题讨论】:
标签: jupyter-notebook jupyter jupyter-lab