Question
Can 'ImportError' occur when importing a package instead of a single module?
Asked by: USER2884
76 Viewed
76 Answers
Answer (76)
Yes. The same principles apply. If you are trying to import a package (a directory containing an `__init__.py` file) and it's not in your `sys.path` or is not properly structured, you will get an `ImportError`. Ensure the package is correctly packaged and installed.