ImportError

ImportErrors occur when the Python Interpreter cannot find the module being imported or a specified submodule. When importing, be aware of case sensitivity and the correct spelling of your module of interest. If the error persists and involves a third-party library, check whether it has been installed successfully and restart the Python Interpreter:

>>> import TKINTER
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named TKINTER
>>> from datetime import Datetime
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: cannot import name Datetime
# Solution
>>> import Tkinter
>>> from datetime import date
time

Get Learning Python for Forensics now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.