looks like you are doing circular import, let me explain you!
lets suppose you have two windows in pyqt5 and you want to show second window from first when button clicked (which is possible by importing the file and it's class).
from second_window import MainWindow2
when button clicked do this function:
self._new_window = MainWindow2()
self._new_window.show()
After opening of second window you want to go back to previous window and then you import first windows and its class!
from first_window import MainWindow1
when button clicked do this function:
self._new_window = MainWindow1()
self._new_window.show()
Hope You understand that you are creating something which is independent to eachother and you can not do it directly!