-
Notifications
You must be signed in to change notification settings - Fork 28
Open
Description
Description
When attempting to execute a PowerShell cell in a Jupyter notebook using VSCode, the kernel fails to start with the following error:
The kernel failed to start due to the missing module 'imghdr'. Consider installing this module.
This error occurs in a Python virtual environment with ipykernel and powershell_kernel installed.
Environment
- OS: Windows 11 Home (23H2, 22631.4602)
- Python version: 3.13.1
- VSCode version: 1.97.0-insider
- powershell_kernel version: 0.1.4
- ipykernel version: 6.29.5
Steps to Reproduce
- Create a new Python virtual environment in a VSCode workspace
- Install
ipykernelandpowershell_kernelin the virtual environment - Open a Jupyter notebook in VSCode using this environment, make sure to select the PowerShell kernel
- Attempt to execute a PowerShell cell
Expected Behavior
The PowerShell cell should execute without errors.
Actual Behavior
The kernel fails to start, citing a missing imghdr module.
Additional Context
The imghdr module was deprecated in Python 3.11 and removed in Python 3.13. It appears that powershell_kernel or one of its dependencies still relies on this module.
Possible Solutions
- Update
powershell_kernelto use an alternative toimghdr(e.g.,filetype,puremagic, orpython-magic) - Add
standard-imghdras a dependency forpowershell_kernel - Provide clear documentation on how users can resolve this issue (e.g., by installing
standard-imghdr)
Question
Is there a plan to address this compatibility issue with newer Python versions that no longer include the imghdr module?
Metadata
Metadata
Assignees
Labels
No labels