簡體   English   中英

您如何解決此錯誤:“ImportError:DLL 加載失敗:找不到指定的模塊。” 使用 PyQt5

[英]How do you fix this error: "ImportError: DLL load failed: The specified module could not be found." using PyQt5

我目前正在使用 Python 3.6.8 和 PyQt5。 我的程序運行良好,但在 Windows 更新后,一切都停止了工作。

這是錯誤:

Traceback (most recent call last):
  File "main.py", line 10, in <module>
    from PyQt5 import QtWidgets, QtCore, QtGui
ImportError: DLL load failed: The specified module could not be found.

我通過在命令提示符下運行以下命令來修復此錯誤:

pip install pyqt5-tools

看起來環境變量在更新后已損壞。 在最簡單的情況下,它應該只是

例如,添加 python 的 DLL 位置,

(C:\Program Files\Python35\DLLs)

在環境變量的path中。 您還可以在此處查看其他一些可能的解決方案

更改您在 IDE 中使用的解釋器,即使用在 cmd 提示符下運行的相同版本的 python。 這解決了我的錯誤。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM