Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change Jupyter Notebook (Windows) shell to bash

I'm currently running Jupyter Notebook (Windows 7) within a Conda environment using Python 3.6.4 and my current version of Jupyter Notebook is 5.6.0. I came across the following article: Using Git Bash in Jupyter Notebook on Windows , that explains how to change the default shell within Jupyter Notebook to Bash by changing the config "C.NotebookApp.terminado_settings = {'shell_command': ['C:\Program Files\Git\bin\bash.exe']}. I've tried multiple different options for the path to bash, including just the name 'bash', with no success.

Python and Jupyter version Python and Jupyter version:

Juypter Notebook shell not changed Jupyter Notebook: Not changed, still using Powershell

I've read up on the Jupyter Notebook: Read the Docs , and made the changes to the jupyter_notebook_config.py found under C:\Users\UserName\.jupyter directory, without any success.

jupter_notebook_config.py terminado configuration

like image 237
Peter Wilson Avatar asked Sep 14 '18 10:09

Peter Wilson


People also ask

Which Shell does Jupyter Notebook use?

The Jupyter project started out as IPython and the IPython Notebook. It was originally a Python-specific interactive shell and notebook environment, which later branched out to become language-agnostic, supporting Julia, Python, and R—and potentially anything else.

How do I open a Jupyter Notebook in Windows Shell?

Windows File Explorer + Command Prompt Once you've entered your specific folder with Windows Explorer, you can simply press ALT + D, type in cmd and press Enter. You can then type jupyter notebook to launch Jupyter Notebook within that specific folder.


1 Answers

An alternative solution to your problem is to use the Windows Subsystem for Linux (WSL). I am under Windows 10, conda 4.5.11 and Jupyter lab 0.35.3. I have also activated the Windows subsystem for Linux (WSL). Using !wsl you can call the WSL or with %%bash for cell magics. Inside Jupyter Lab I have: enter image description here

is the %%bash cell magic referring to the WSL? According to my tests yes, I can access the same programs and I am taken to the WSL when I run bash.exe from the Conda prompt. There is an integration of the PowerShell prompt to WSL (https://docs.microsoft.com/en-us/windows/wsl/interop). The same seems to work with the conda prompt.

like image 169
BND Avatar answered Sep 27 '22 22:09

BND