In general, you shouldn't import stuff from a module which itself has only imported it:
# gui.py
from PyQt5 import QtCore, QtGui, QtWidgets
def some_function():
pass
you should then do:
# main.py
from PyQt5 import QtCore, QtGui, QtWidgets
from gui import some_function
The only exception are __init__.py
files that aggregate modules from its submodules for convenience reasons:
# some_module/__init__.py
from .submodule import some_function
from .other_submodule import some_other_function
and then
# main.py
from .some_module import some_function, some_other_function
Since the're not modules that are provided by gui
you should just import them directly from PyQt5
.