修改Jupyter主目录的问题

时间:2018-05-12 01:05:10

标签: jupyter-notebook jupyter jupyter-lab

有一次我将我的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

c.NotebookApp.notebook_dir = '/Users/alex/'中设置/Users/alex/.jupyter/jupyter_notebook_config.py似乎无效。

$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主目录可以从哪里设置?

0 个答案:

没有答案