我目前在使用Python 3.6.4的Conda环境中运行Jupyter Notebook (Windows7),我当前的Jupyter Notebook版本是5.6.0。我读到了下面这篇文章:Using Git Bash in Jupyter Notebook on Windows ,它解释了如何通过更改配置"C.NotebookApp.terminado_settings = {' shell _command':'C:\Program Files\Git\bin\bash.exe'}将Jupyter Notebook中的默认shell更改为bash。

Python和Jupyter版本:

Jupyter Notebook:未更改,仍使用Powershell
我已经阅读了Jupyter Notebook: Read the Docs ,并对C:\Users\UserName.jupyter目录下的jupyter_notebook_config.py进行了更改,但没有成功。

发布于 2019-03-23 14:30:25
您的问题的另一个解决方案是使用Windows Subsystem for Linux (WSL)。我使用的是Windows 10、conda 4.5.11和Jupyter lab 0.35.3。我还激活了Linux的Windows子系统(WSL)。使用!wsl,您可以调用WSL,或者使用%%bash实现细胞魔术。在Jupyter Lab中,我有:

%%bash单元是指WSL吗?根据我的测试,是的,我可以访问相同的程序,当我从Conda提示符运行bash.exe时,我被带到WSL。将PowerShell提示符集成到WSL (https://docs.microsoft.com/en-us/windows/wsl/interop)。这似乎也适用于conda提示符。
发布于 2020-03-24 22:46:45
这里有三个选项:
jupyter notebook打开Jupyter notebook,那么如果希望始终能够在通过Anaconda Prompt打开的Jupyter Notebook中运行bash (类似于使用jupyter notebook): ),那么%%bash magics应该可以运行
- Edit the Jupyter Notebook config file: - Location can be found via Anaconda Prompt with `jupyter --config-dir`
- Open the jupyter\_notebook\_config.py file in this directory using notepad or an IDE
- Modify and save with the line of code: `c.NotebookApp.terminado_settings = {}` pointed instead to your bash executible (e.g.): `c.NotebookApp.terminado_settings = { 'shell_command': ['C:\Program Files\Git\bin\bash.exe'] }`
- Edit your system environment variables: - Windows Search (with admin rights) > "Edit the System Environment Variables" > Environment Variables > Highlight "path" > Edit > Add a new line with C:\Program Files\Git\bin > OK out of all windows
https://stackoverflow.com/questions/52330492
复制相似问题