How to use Git Bash on Jupyterlab

Viewed 2820

Instead of running PowerShell on Jupyterlab, I wish I could just be using Gitbash instead. Some resources I found do not meet my requirements.
Some said I should run this command on the terminal jupyter --config -dir and copy the return link i.e., .jupyter/jupyter_notebook_config.py to the file explorer that I will find a Python script there and I should modify some content but I couldn't find any Python script there, all I saw was JSON file.

After lots of research, I found that in order to generate the Python script file I will have to run this jupyter notebook --generate-config. When I opened the file all I could see are comments, please any idea of what to do next?

2 Answers

Changing Terminal to Gitbash in JupyterLab Resolved

This can be fixed by pasting this code below or above the comments. And make sure to restart the JupyterLab to see the changes.

c.NotebookApp.terminado_settings = {
'shell_command': ['C:\\Program Files\\Git\\bin\\bash.exe']
}

i.e., you place the string containing the path of the bash.exe or any other terminal path you wish to use as described above in a list as described above.

I've been using bash to start Jupyter Lab / Jupyter Notebook for a couple years. The "Open in Bash" is an item on the mouse context menu. Just click on the File Explorer (pinned to the taskbar), then the "R Projects" folder is selected (pinned under Quick Access). Then just right click mouse to open the context menu, and select, Open in Bash.

When the MINGGW64 terminal opens (labeled MINGW64:/c/Python), just type, Jupyter Lab to get a Notebook started. I usually "Open in Bash" at the top of the, C:/ R Projects folder. That way when using Jupyter, all the subfolders in the R Projects folder can be easily accessed using the Jupyter, File Browser.

I do not use Anaconda. IMO, Anaconda should only be used by rank amateurs. Anaconda puts a layer of "unknown" between the user and the software packages. A person cannot become accomplished in understanding software package management and package dependencies while using Anaconda. Use pip or die.

Anyway ... from my not so perfect notes I think I did the following.

Installed Git Bash using the default installation settings and folder. C:\Program Files\Git . "make sure to select, git bash here". Choose, use Git from Git Bash only. (I don't know why this was chosen). I just found the Git setup at:

https://www.stanleyulili.com/git/how-to-install-git-bash-on-windows/#step-5-select-components

I normally always follow the default setting for everything and never choose any just released versions, or any experimental options.

I set the Path in System variables (Environmental Variables). It reads; C:\Program Files\Git\cmd. I also found in the Path in the Environmental Variables, C:\miniGW\bin. The allows the Open in Bash to start from any folder on the PC.

My notes are done. So that's probably all that was necessary to get things working. Just send me a note if things don't work out.

I've got some notes in OneNote about how I got things bash installed and functioning. I'll assume you are using Windows.

Related