【发布时间】:2021-09-21 11:22:31
【问题描述】:
我想做的是为必须在 WSL 中运行的 Jupyter Notebook 创建一个快捷方式(因为我所有的 python 包都在那里)。对于这个 AFAIK,我应该创建 PowerShell 脚本,该脚本运行 WSL 并使用命令启动 Jupyter Notebook,如下所示:
wsl -e bash -c "jupyter notebook"
但是这个命令给出了bash: jupyter: command not found,尽管如果我一步一步地这样做,它会启动 Jupyter:
PS C:\Users\Artem> wsl
(base) artem@LAPTOP-O4C3S1UK:/mnt/c/Users/Artem$ jupyter notebook
所有经过测试的命令都存在以下问题之一:
- bash 找不到命令(
jupyter或anaconda都找不到) - 一些终端启动并立即消失
我对 PowerShell/WSL 脚本编写不够精通,因此请教如何正确执行此操作。
附:我想我可以为 Windows 安装 jupyter 并从 WSL 添加内核,但我想知道问题是否可以通过上述方式解决。
【问题讨论】:
标签: bash powershell jupyter-notebook windows-subsystem-for-linux wsl-2