Skip to content

Failure to start kernel due to failures in importing modules

Don Jayamanne edited this page Nov 15, 2021 · 6 revisions

Python kernels can fail to start if some modules such as pytprocess 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 correct, hence try the reinstall option as follows:
    • python -m pip install <xyz> -U --fore-reinstall
    • conda install --name <environment name> --update-deps --force-reinstall (if using Conda environments)
  • If none of these work, please ensure you do not have any user code that's overriding any built in modules.
Clone this wiki locally