ImportError
The exception raised when an import fails, for example because a name does not exist inside a module.
In more detail
from math import sqroot raises it because math has no sqroot. A circular import between two of your own modules can also cause it.
Related terms
- exception — An error object a program raises to stop normal flow and report that something went wrong.
- traceback — The report Python prints when an unhandled exception stops a program, listing the chain of calls that led there and ending with the error.
Taught in
- Reading A Traceback Like A Professional — Hands-on Python: Complete Video Course & Book
- Packages, And Your Own Library — Hands-on Python: Complete Video Course & Book
- Import Variants, dir() And sys.path — PCAP Certified Associate in Python Programming (PCAP-31-03) Exam Prep
- Modules Sprint — PCAP Certified Associate in Python Programming (PCAP-31-03) Exam Prep