Skip to content

bash_kernel install with conda on windows 11 with GitBash #155

Description

@ENIAC-6

I've been trying to get a bash kernel running from jupyter notebook but can't get it to work. Wondering if someone could assist with instructions similar to here, but for Windows 11, and using GitBash instead of WSL (my install is not working). I also need to use conda only, no pip.

Here's an example of what I've tried in python command prompt:

    conda create --name bash_env -c conda-forge gdal # I need gdal
    activate bash_env
    conda install bash_kernel -c conda-forge

Running the following gave me an error: python -m bash_kernel.install --user

(bash_env) C:\Path\To\ArcGIS\Pro\Python\envs\bash_env>python -m bash_kernel.install
Traceback (most recent call last):
File "", line 189, in _run_module_as_main
File "", line 112, in get_module_details
File "C:\Path\To\ArcGIS\Pro\Python\envs\bash_env\Lib\site-packages\bash_kernel_init
.py", line 3, in
from .kernel import version
File "C:\Path\To\ArcGIS\Pro\Python\envs\bash_env\Lib\site-packages\bash_kernel\kernel.py", line 15, in
from .images import (
extract_image_filenames, display_data_for_image, image_setup_cmd
)
File "C:\Path\To\ArcGIS\Pro\Python\envs\bash_env\Lib\site-packages\bash_kernel\images.py", line 2, in
import imghdr
ModuleNotFoundError: No module named 'imghdr'

I downgraded to python 3.12 per this post
conda install python=3.12
I then reran python -m bash_kernel.install --user

I installed jupyter conda install -c conda-forge jupyter
When I open jupyter notebook with jupyter notebook and select the Bash kernel, I get the following error: Error Starting Kernel [WinError 2] The system cannot find the file specified

Within GitBash, where bash returns
C:\Program Files\Git\usr\bin\bash.exe
C:\Windows\System32\bash.exe
C:\Users<USERNAME>\AppData\Local\Microsoft\WindowsApps\bash.exe

kernel.json within the following directory C:\Users<USERNAME>\AppData\Local\Programs\ArcGIS\Pro\bin\Python\envs\bash_env\share\jupyter\kernels\bash

reads
{"argv": [C:/Users//AppData/Local/Programs/ArcGIS/Pro/bin/Python/envs/bash_env/bin/python", "-m", "bash_kernel", "-f", "{connection_file}"], "codemirror_mode": "shell", "display_name": "Bash", "env": {"PS1": "$"}, "language": "bash"}

Thank you

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions