Jupyter Windows默认情况下损坏的快捷方式 [英] Jupyter windows shortcut corrupt by default

查看:128
本文介绍了Jupyter Windows默认情况下损坏的快捷方式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

安装Anaconda后,Jupyter笔记本快捷方式可以正常工作.其他stackoverflow答案表明,您可以通过更改快捷方式属性中的开始于:"字段来更改默认工作目录.但是,如果Anaconda安装在建议文件夹中,供单个用户C:\Users\whshg0\AppData\Local\Continuum\Anaconda3\使用,则在编辑Start in字段时,快捷方式的Target字段将被截断.示例:

After installing Anaconda, the Jupyter notebook shortcut works fine. Other stackoverflow answers have indicated that you can change the default working directory by changing the "Start In:" field in the shortcut properties. However, if Anaconda is installed in the suggested folder for single users C:\Users\whshg0\AppData\Local\Continuum\Anaconda3\, then the Target field of the shortcut gets truncated when you edit the Start in field. Example:

C:\Users\user01\AppData\Local\Continuum\Anaconda3\python.exe C:\Users\user01\AppData\Local\Continuum\Anaconda3\cwp.py C:\Users\user01\AppData\Local\Continuum\Anaconda3 "C:/Users/user01/AppData/Local/Continuum/Anaconda3/python.exe" "C:/Users/user01/AppData/Loc

al/Continuum/Anaconda3/Scripts/jupyter-notebook-script.py"被截断.单击确定后,Jupyter Notebook将不再打开.

al/Continuum/Anaconda3/Scripts/jupyter-notebook-script.py" gets truncated. After you click ok, Jupyter Notebook will no longer open.

什么是重建Jupyter Notebook快捷方式的快速方法,以使Target不仅限于255个字符的限制?

What is a fast way to rebuild the Jupyter Notebook shortcut so the Target is not limited to the 255 character limit?

推荐答案

我发现更改默认工作目录的最简洁方法是编辑Anaconda文件夹中的cwp.py文件,如下所示(在文件末尾) :

The cleanest way I found to change the default working directory is to edit the cwp.py file in the Anaconda folder as following (at the end of the file):

替换此行:

os.chdir(documents_folder)

os.chdir(documents_folder)

包含您要在其中开始的文件夹:

with the folder you want to start in:

os.chdir("C:\\ Private_Files \\ MachineLearning")

os.chdir("C:\\Private_Files\\MachineLearning")

这篇关于Jupyter Windows默认情况下损坏的快捷方式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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