Jupyter Notebook Set Default Folder to Root

人走茶凉 提交于 2019-12-10 10:26:59

问题


I am using Jupyter Notebook on Windows 7, and I want to set the default foler to D:. Currently, I have the following line in my jupyter_notebook_config.py:

c.NotebookApp.notebook_dir = 'D:/'

When I open Jupyter Notebook, in the browser I receive the following message:

404 : Not Found You are requesting a page that does not exist!

In the prompt, I get the following output:

[W 14:12:45.477 NotebookApp] ipywidgets package not installed.  Widgets are unavailable.
[I 14:12:45.497 NotebookApp] Serving notebooks from local directory: D:/
[I 14:12:45.497 NotebookApp] 0 active kernels
[I 14:12:45.497 NotebookApp] The IPython Notebook is running at: http://localhost:8888/
[I 14:12:45.497 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[I 14:12:45.747 NotebookApp] Refusing to serve hidden directory, via 404 Error
[W 14:12:45.790 NotebookApp] 404 GET /tree (::1) 44.00ms referer=None

But, if I change my config file to point to a folder, eveything works fine. For example, the following line in config works:

c.NotebookApp.notebook_dir = 'D:/Dropbox'

Is there any way that I can set the Jupyter default folder to the root drive?


回答1:


Refusing to serve hidden directory, via 404 Error points to no write permissions on the drive.

IF you change security permissions on your D:\, you can use it as a default folder for Jupyter Notebook. You have to turn off UAC (User Account Control settings) from the Windows Control Panel (it blocks programs from writing to the root directory for security, must login as Admin to turn it off). You'll have to run the program as Administrator. This guide here is probably the best way to do it: https://superuser.com/a/753068

Remember the UAC is there to prevent unauthorized apps from writing to your root directory, so probably not the best thing to turn off. You could alternatively map a directory as another drive letter if you're just doing the D:\ for convenience.

So in summary your error message is due to selecting a directory where Windows tries to protect you from viruses, and is locked out by apps unless you turn off those protections.



来源:https://stackoverflow.com/questions/36657137/jupyter-notebook-set-default-folder-to-root

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!