2016-04-27 39 views
0

每次当我想要启动ipython笔记本时,我必须在Windows命令行cmdpowershell中键入“jupyter notebook”。是否可以设置别名?我试着做这powershell如何在PowerShell中为“jupyter notebook”设置别名?

New-Alias nb "jupyter notebook" 

nb失败,因为powershell无法识别jupyter notebook为cmdlet或功能。

那么如何设置别名并将其保存在powershell?有没有更好的主意在Windows上启动ipython notebook

+1

可能它不喜欢它,因为它包含一个参数,而不仅仅是可执行文件的名称?改用'jupyter-notebook'来代替。 –

回答

0

您需要包含可执行文件的路径而不是“jupyter notebook”,因为该程序不在您的$ env:路径中。

new-alias nb "C:\SomePath\JupyterNotebook.exe" 

而且你需要把此行的PowerShell配置文件(〜\文档\ WindowsPowerShell \ Microsoft.PowerShell_profile.ps1),所以它会在您每次启动PowerShell的时间。

+0

非常感谢。我必须添加:'New-Item -path $ profile -type file -force '来创建一个配置文件,并且'Set-ExecutionPolicy RemoteSigned '允许执行脚本。 – Nick