Skip to content

Failure to start kernel due to failures in importing modules

Don Jayamanne edited this page May 30, 2022 · 6 revisions

Python kernels can fail to start if some modules such as ptyprocess ipykernel, pyzmq, etc fail to load due to improper installation, or upgrading one module and not the related dependencies or the like.

Sometimes, user code such as os.py or random.py could also prevent the kernel from starting.

Recommended solution

  • Please consider installing the modules that could not be imported.
  • If they have already been installed, its possible it hasn't been installed correctly, hence try the reinstall option as follows:
# if using a non-conda environment
python -m pip install <xyz> -U --force-reinstall
# If using a conda environment
conda install --name <environment name> <xyz> --update-deps --force-reinstall
Clone this wiki locally