Actually I got this error pretty strange way. It seems to be pyinstaller interprets the closed lines that are not supposed to be taken into account. For example to understand whether the class I wrote was working well I added a line, on which a local image was imported. I'd actually closed that line with # afterwards but the exe I generated by pyinstaller didnt ignore that line and tried to import that image and throwed this error.
I deleted the related closed line and generated the exe again and bingo. The issue is gone.