Error due to missing `dateutil` import when starting jupyter notebook

I’m trying to start up my Jupyter Notebook (jupyter notebook in command line, and I’m not using any environments) and keep getting this error:

Traceback (most recent call last):
  File "/usr/local/bin/jupyter-notebook", line 5, in <module>
    from notebook.notebookapp import main
  File "/usr/local/lib/python3.9/site-packages/notebook/", line 78, in <module>
    from .services.kernels.kernelmanager import MappingKernelManager, AsyncMappingKernelManager
  File "/usr/local/lib/python3.9/site-packages/notebook/services/kernels/", line 18, in <module>
    from jupyter_client.session import Session
  File "/usr/local/lib/python3.9/site-packages/jupyter_client/", line 6, in <module>
    from .asynchronous import AsyncKernelClient  # noqa
  File "/usr/local/lib/python3.9/site-packages/jupyter_client/asynchronous/", line 1, in <module>
    from .client import AsyncKernelClient  # noqa
  File "/usr/local/lib/python3.9/site-packages/jupyter_client/asynchronous/", line 6, in <module>
    from jupyter_client.channels import HBChannel
  File "/usr/local/lib/python3.9/site-packages/jupyter_client/", line 15, in <module>
    from .session import Session
  File "/usr/local/lib/python3.9/site-packages/jupyter_client/", line 52, in <module>
    from jupyter_client.jsonutil import extract_dates
  File "/usr/local/lib/python3.9/site-packages/jupyter_client/", line 15, in <module>
    from dateutil.parser import parse as _dateutil_parse  # type: ignore
ModuleNotFoundError: No module named 'dateutil'

I have tried the following fixes, to no avail:

  1. Completely uninstall, then reinstally jupyter and related packages (including dependencies)
  2. Check which python I have and what is pointing where (this error indicates I’m getting the error with my Python 3.9 installation)
  3. Run a code which imports dateutil. It also cannot find dateutil.
  4. Install dateutil using pip. I still get the error even though python-dateutil shows up during pip list

Any ideas as to what might be wrong? My suspicion is that I have a path somewhere that’s pointing to the wrong thing, which is why Python3 on my machine can’t find the dateutil package.

Did you try to uninstall and reinstall just dateutil as suggested in comments here?

pip uninstall python-dateutil
pip install python-dateutil

Maybe try adding --force-reinstall --upgrade to the install line?

1 Like

--force-reinstall --upgrade worked!!! Thank you.

1 Like