0
from PyQt5 import QtCore, QtGui, QtWidgets
from PyQt5.QtCore import Qt
from PyQt5.QtWidgets import QLineEdit, QFileDialog
from qtpy import QtWidgets

and problem is:

  from PyQt5 import QtCore, QtGui, QtWidgets
ImportError: cannot import name 'QtCore' from partially initialized module 'PyQt5' (most likely due to a circular import)
eyllanesc
  • 235,170
  • 19
  • 170
  • 241
GGacEEE
  • 15
  • 4

2 Answers2

0

Make sure PyQt5 is installed correctly using

pip install PyQt5

Also make sure, there is no other file, named with same name as module (PyQt5) in current directory of your program.

TechySharnav
  • 4,869
  • 2
  • 11
  • 29
  • ImportError: DLL load failed while importing QtCore: The specified module could not be found. Now i have this error – GGacEEE Feb 26 '21 at 11:39
  • Try this: https://stackoverflow.com/questions/61463432/how-do-you-fix-this-error-importerror-dll-load-failed-the-specified-module-c – TechySharnav Feb 26 '21 at 12:18
0

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!

shailu
  • 190
  • 1
  • 10