1

I've got a problem in Pycharm while running the following code:

import sys
from PyQt5.QtWidgets import QApplication, QWidget, QLabel, QVBoxLayout
from PyQt5.QtCore import QTimer, QTime, Qt

class DigitalClock(QWidget):
    def __init__(self):
        super().__init__()
        self.initUI()

    def initUI(self):
        pass

if __name__ == '__main__':
    app = QApplication(sys.argv)
    clock = DigitalClock()
    clock.show()
    sys.exit(app.exec_())

When I run it, the terminal gives me the following error message:

Traceback (most recent call last):
  File "C:\Users\nnils\PycharmProjects\DigitalClock\main.py", line 2, in <module>
    from PyQt5.QtWidgets import QApplication, QWidget, QLabel, QVBoxLayout
ImportError: DLL load failed while importing QtWidgets: Die angegebene Prozedur wurde nicht gefunden.

Process finished with exit code 1

What can I do to fix this problem?

I already tried to uninstall PyQt5 and reinstall it but the error stayed. Also I've tried to completely reinstall Pycharm and my Python interpreter. Plus changing the interpreter to an earlier version did not help either.

1 Answer 1

1

I was able to fix the issue by simply creating a new Project and pasting the same code there. Maybe in the original project there was a bug or a problem in the file structure.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.