ImportError: No module named ‘exceptions’

The error:

Traceback (most recent call last):
  File "D:\pyhomelib\mainwindow.py", line 19, in <module>
    from sqlquerymodel import SqlQueryModel
  File "D:\pyhomelib\sqlquerymodel.py", line 4, in <module>
    from exceptions import Exception
ImportError: No module named 'exceptions'

The problem:

from exceptions import Exception

Explanation:

In Python 3, exceptions module was removed and all standard exceptions were moved to builtin module. 
Thus meaning that there is no more need to do explicit import of any standard exceptions.
Advertisements