Jupyter Notebook将默认文件夹设置为Root [英] Jupyter Notebook Set Default Folder to Root

查看:529
本文介绍了Jupyter Notebook将默认文件夹设置为Root的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Windows 7上使用Jupyter Notebook,我想将默认的foler设置为 D:
目前,我在jupyter_notebook_config.py中有以下行:

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:/'

当我打开Jupyter Notebook时,在浏览器中收到以下消息:

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

但是,如果我将配置文件更改为指向文件夹,则eveything工作正常。例如,配置中的以下行有效:

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'

有什么方法可以将Jupyter默认文件夹设置为根驱动器吗?

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

推荐答案

拒绝提供隐藏目录,通过404错误指向驱动器上没有写入权限。

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

如果您更改了D:\的安全权限,则可以将其用作Jupyter Notebook的默认文件夹。您必须从Windows控制面板关闭UAC(用户帐户控制设置)(为了安全起见,它会阻止程序写入根目录,必须以管理员身份登录才能将其关闭)。您必须以管理员身份运行该程序。这里的指南可能是最好的方法: https://superuser.com/a/753068

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

请记住,UAC是为了防止未经授权的应用程序写入您的根目录,因此可能不是关闭的最佳选择。你可以选择将一个目录映射为另一个驱动器号,如果你只是为了方便而做D:\。

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.

总而言之,你的错误信息是由于选择了一个Windows试图保护您免受病毒侵害的目录,除非您关闭这些保护措施,否则会被应用程序锁定。

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.

这篇关于Jupyter Notebook将默认文件夹设置为Root的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆