我试着按照Jupyter笔记本文档上的说明去做。
不幸的是,我还没弄明白。这个“开始”的领域到底在哪里?
我有一个windows 7(64位)系统,安装了Anaconda3(不在C驱动器中)。我想改变Jupyter开始文件夹的位置。
我试着按照Jupyter笔记本文档上的说明去做。
不幸的是,我还没弄明白。这个“开始”的领域到底在哪里?
我有一个windows 7(64位)系统,安装了Anaconda3(不在C驱动器中)。我想改变Jupyter开始文件夹的位置。
当前回答
以防有人还在寻找答案/其他选择。这是最适合我的。
创建一个.bat文件。 在.bat文件中。将C:\Users\usr\folders\更改为jupyter notebook默认打开的文件夹。 cd C:\Users\usr\folders jupyter笔记本 保存.bat文件并将其放置在任何您想要的位置。通常我会为我正在做的每个项目创建.bat文件。把这些.bat文件看作是快捷方式。 双击。bat文件启动jupyter笔记本在预定的路径。
其他回答
对于Windows用户,这里有一个片段,让你右键单击文件夹并打开Jupyter实验室。
def add_jupyter_to_context_menu(self):
import winreg
key = winreg.HKEY_CURRENT_USER
command_value = rf'cmd.exe /k jupyter lab --notebook-dir="%V"'
handle = winreg.CreateKeyEx(key, "Software\Classes\directory\Background\shell\Open with JupyterLab\command", 0,
winreg.KEY_SET_VALUE)
winreg.SetValueEx(handle, "", 0, winreg.REG_SZ, command_value)
# You need to download the icon yourself, or leave this part out for no icon
icon_value = fr"C:\some_folder\jupyter_icon.ico"
handle = winreg.CreateKeyEx(key, "Software\Classes\directory\Background\shell\Open with JupyterLab", 0,
winreg.KEY_SET_VALUE)
winreg.SetValueEx(handle, "icon", 0, winreg.REG_SZ, icon_value)
def remove_jupyter_from_context_menu(self):
import winreg
key = winreg.HKEY_CURRENT_USER
winreg.DeleteKey(key, "Software\Classes\directory\Background\shell\Open with JupyterLab\command")
winreg.DeleteKey(key, "Software\Classes\directory\Background\shell\Open with JupyterLab")
CD导入目录或父目录(与打算的目录将工作嵌套在其中)。
注意它必须是一个文件夹(E:\>—这将不起作用)
然后运行命令jupyter notebook
[1] cd e:
通过以下方法进行测试:
[2] pwd
我用的是Windows 10,不过是同一个版本的Anaconda。
Click on the Start Menu, then All Programs (just Programs for Win10) Click on the Anaconda3 folder; mine is Anaconda3 (64-bit) In there you should see Jupyter Notebook. If you have a virtual environment installed, it will be followed by the environment name like this: Jupyter Notebook (env) Right-click Jupyter Notebook entry and navigate to More => Open File Location Right-click the correct Jupyter Notebook entry, then click on Properties Enter a path in the Start in: box; if the path has spaces in it, you must enclose it in double quotes Delete "%USERPROFILE%" at the end of the executable path
所以上面的答案是有帮助的,但请允许我把它弄清楚,这样其他不太熟悉MS-Windows的人也可以用同样的方法来解决:
当Windows 10使用Python、Ipython和Jupyter Notebook安装Anaconda时,会发生此问题。
首先打开Anaconda Prompt,并在提示符中输入以下内容:
jupyter notebook --generate-config
你会得到这样的结果:
你不用再按提示做任何事了。出于隐私考虑,我没有快照我的完整地址,但它显示了如下内容:
C:\Users\name\.jupyter
在C:驱动器上找到这个文件夹,在这个文件夹中找到python文件jupyter_notebook_config.py。将文件拖到notepad++中进行编辑。 在编辑时,查看第214行,寻找如下的字符串:
#c.NotebookApp.notebook_dir = ''
取消注释,即删除第一列中的“#”。现在将目标文件夹地址添加到' '中,如下所示:
c.NotebookApp.notebook_dir = 'C:\\Users\\name\\Desktop\\foldername'
然后保存文件。然后再次打开蟒蛇提示,输入jupyter notebook。这应该启动Jupyter笔记本在浏览器的文件夹与上述地址。这里的关键是UNCOMMENT(意思是删除)行前面的#,然后在文件夹之间使用\\双斜杠(作为路径分隔符)。如果您只使用单个斜杠\,它将不起作用。
这是所有。